Staging: brcm80211: s/int32/s32/
Use the kernel types, don't invent your own. Cc: Brett Rudley <brudley@broadcom.com> Cc: Henry Ptasinski <henryp@broadcom.com> Cc: Nohee Ko <noheek@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
66cbd3ab35
commit
3e26416e2f
@ -186,7 +186,7 @@ u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
|
||||
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
|
||||
SDIOH_API_RC status;
|
||||
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
|
||||
int32 retry = 0;
|
||||
s32 retry = 0;
|
||||
#endif
|
||||
u8 data = 0;
|
||||
|
||||
@ -222,7 +222,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
|
||||
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
|
||||
SDIOH_API_RC status;
|
||||
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
|
||||
int32 retry = 0;
|
||||
s32 retry = 0;
|
||||
#endif
|
||||
|
||||
if (!bcmsdh)
|
||||
|
@ -404,7 +404,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
const bcm_iovar_t *vi = NULL;
|
||||
int bcmerror = 0;
|
||||
int val_size;
|
||||
int32 int_val = 0;
|
||||
s32 int_val = 0;
|
||||
bool bool_val;
|
||||
u32 actionid;
|
||||
|
||||
@ -449,7 +449,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
actionid = set ? IOV_SVAL(vi->varid) : IOV_GVAL(vi->varid);
|
||||
switch (actionid) {
|
||||
case IOV_GVAL(IOV_MSGLEVEL):
|
||||
int_val = (int32) sd_msglevel;
|
||||
int_val = (s32) sd_msglevel;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -458,7 +458,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_BLOCKMODE):
|
||||
int_val = (int32) si->sd_blockmode;
|
||||
int_val = (s32) si->sd_blockmode;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -472,7 +472,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
bcmerror = BCME_BADARG;
|
||||
break;
|
||||
}
|
||||
int_val = (int32) si->client_block_size[int_val];
|
||||
int_val = (s32) si->client_block_size[int_val];
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -519,7 +519,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_DMA):
|
||||
int_val = (int32) si->sd_use_dma;
|
||||
int_val = (s32) si->sd_use_dma;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -528,7 +528,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_USEINTS):
|
||||
int_val = (int32) si->use_client_ints;
|
||||
int_val = (s32) si->use_client_ints;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -587,12 +587,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_NUMINTS):
|
||||
int_val = (int32) si->intrcount;
|
||||
int_val = (s32) si->intrcount;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_NUMLOCALINTS):
|
||||
int_val = (int32) 0;
|
||||
int_val = (s32) 0;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
|
@ -995,7 +995,7 @@ int bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set)
|
||||
case IOVT_UINT8:
|
||||
case IOVT_UINT16:
|
||||
case IOVT_UINT32:
|
||||
/* all integers are int32 sized args at the ioctl interface */
|
||||
/* all integers are s32 sized args at the ioctl interface */
|
||||
if (len < (int)sizeof(int))
|
||||
bcmerror = BCME_BUFTOOSHORT;
|
||||
break;
|
||||
|
@ -205,7 +205,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
|
||||
int val_size)
|
||||
{
|
||||
int bcmerror = 0;
|
||||
int32 int_val = 0;
|
||||
s32 int_val = 0;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
@ -223,7 +223,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_MSGLEVEL):
|
||||
int_val = (int32) dhd_msg_level;
|
||||
int_val = (s32) dhd_msg_level;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -238,12 +238,12 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_BCMERROR):
|
||||
int_val = (int32) dhd_pub->bcmerror;
|
||||
int_val = (s32) dhd_pub->bcmerror;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_WDTICK):
|
||||
int_val = (int32) dhd_watchdog_ms;
|
||||
int_val = (s32) dhd_watchdog_ms;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -261,7 +261,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
|
||||
|
||||
#ifdef DHD_DEBUG
|
||||
case IOV_GVAL(IOV_DCONSOLE_POLL):
|
||||
int_val = (int32) dhd_console_ms;
|
||||
int_val = (s32) dhd_console_ms;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -289,7 +289,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_IOCTLTIMEOUT):{
|
||||
int_val = (int32) dhd_os_get_ioctl_resp_timeout();
|
||||
int_val = (s32) dhd_os_get_ioctl_resp_timeout();
|
||||
bcopy(&int_val, arg, sizeof(int_val));
|
||||
break;
|
||||
}
|
||||
|
@ -1797,7 +1797,7 @@ static int dhd_open(struct net_device *net)
|
||||
u32 toe_ol;
|
||||
#endif
|
||||
int ifidx = dhd_net2idx(dhd, net);
|
||||
int32 ret = 0;
|
||||
s32 ret = 0;
|
||||
|
||||
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
|
||||
|
||||
|
@ -234,12 +234,12 @@ typedef struct dhd_bus {
|
||||
|
||||
uint clkstate; /* State of sd and backplane clock(s) */
|
||||
bool activity; /* Activity flag for clock down */
|
||||
int32 idletime; /* Control for activity timeout */
|
||||
int32 idlecount; /* Activity timeout counter */
|
||||
int32 idleclock; /* How to set bus driver when idle */
|
||||
int32 sd_divisor; /* Speed control to bus driver */
|
||||
int32 sd_mode; /* Mode control to bus driver */
|
||||
int32 sd_rxchain; /* If bcmsdh api accepts PKT chains */
|
||||
s32 idletime; /* Control for activity timeout */
|
||||
s32 idlecount; /* Activity timeout counter */
|
||||
s32 idleclock; /* How to set bus driver when idle */
|
||||
s32 sd_divisor; /* Speed control to bus driver */
|
||||
s32 sd_mode; /* Mode control to bus driver */
|
||||
s32 sd_rxchain; /* If bcmsdh api accepts PKT chains */
|
||||
bool use_rxchain; /* If dhd should use PKT chains */
|
||||
bool sleeping; /* Is SDIO bus sleeping? */
|
||||
bool rxflow_mode; /* Rx flow control mode */
|
||||
@ -461,12 +461,12 @@ static int dhdsdio_download_code_array(struct dhd_bus *bus);
|
||||
|
||||
static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size)
|
||||
{
|
||||
int32 min_size = DONGLE_MIN_MEMSIZE;
|
||||
s32 min_size = DONGLE_MIN_MEMSIZE;
|
||||
/* Restrict the memsize to user specified limit */
|
||||
DHD_ERROR(("user: Restrict the dongle ram size to %d, min %d\n",
|
||||
dhd_dongle_memsize, min_size));
|
||||
if ((dhd_dongle_memsize > min_size) &&
|
||||
(dhd_dongle_memsize < (int32) bus->orig_ramsize))
|
||||
(dhd_dongle_memsize < (s32) bus->orig_ramsize))
|
||||
bus->ramsize = dhd_dongle_memsize;
|
||||
}
|
||||
|
||||
@ -634,7 +634,7 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
|
||||
static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
|
||||
{
|
||||
int err;
|
||||
int32 iovalue;
|
||||
s32 iovalue;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
@ -2100,7 +2100,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
int val_size)
|
||||
{
|
||||
int bcmerror = 0;
|
||||
int32 int_val = 0;
|
||||
s32 int_val = 0;
|
||||
bool bool_val = 0;
|
||||
|
||||
DHD_TRACE(("%s: Enter, action %d name %s params %p plen %d arg %p "
|
||||
@ -2131,7 +2131,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
if (IOV_ISSET(actionid)) {
|
||||
bcmerror = dhdsdio_bussleep(bus, bool_val);
|
||||
} else {
|
||||
int_val = (int32) bus->sleeping;
|
||||
int_val = (s32) bus->sleeping;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
}
|
||||
goto exit;
|
||||
@ -2145,7 +2145,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
|
||||
switch (actionid) {
|
||||
case IOV_GVAL(IOV_INTR):
|
||||
int_val = (int32) bus->intr;
|
||||
int_val = (s32) bus->intr;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2166,7 +2166,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_POLLRATE):
|
||||
int_val = (int32) bus->pollrate;
|
||||
int_val = (s32) bus->pollrate;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2188,7 +2188,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_IDLECLOCK):
|
||||
int_val = (int32) bus->idleclock;
|
||||
int_val = (s32) bus->idleclock;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2197,7 +2197,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_SD1IDLE):
|
||||
int_val = (int32) sd1idle;
|
||||
int_val = (s32) sd1idle;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2260,12 +2260,12 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
}
|
||||
|
||||
case IOV_GVAL(IOV_MEMSIZE):
|
||||
int_val = (int32) bus->ramsize;
|
||||
int_val = (s32) bus->ramsize;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_SDIOD_DRIVE):
|
||||
int_val = (int32) dhd_sdiod_drive_strength;
|
||||
int_val = (s32) dhd_sdiod_drive_strength;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2284,7 +2284,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_READAHEAD):
|
||||
int_val = (int32) dhd_readahead;
|
||||
int_val = (s32) dhd_readahead;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2295,7 +2295,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_SDRXCHAIN):
|
||||
int_val = (int32) bus->use_rxchain;
|
||||
int_val = (s32) bus->use_rxchain;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2306,7 +2306,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
bus->use_rxchain = bool_val;
|
||||
break;
|
||||
case IOV_GVAL(IOV_ALIGNCTL):
|
||||
int_val = (int32) dhd_alignctl;
|
||||
int_val = (s32) dhd_alignctl;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2338,10 +2338,10 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
|
||||
addr = (uintptr) bus->regs + sd_ptr->offset;
|
||||
size = sd_ptr->func;
|
||||
int_val = (int32) bcmsdh_reg_read(bus->sdh, addr, size);
|
||||
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
|
||||
if (bcmsdh_regfail(bus->sdh))
|
||||
bcmerror = BCME_SDIO_ERROR;
|
||||
bcopy(&int_val, arg, sizeof(int32));
|
||||
bcopy(&int_val, arg, sizeof(s32));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2371,10 +2371,10 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
|
||||
addr = SI_ENUM_BASE + sdreg.offset;
|
||||
size = sdreg.func;
|
||||
int_val = (int32) bcmsdh_reg_read(bus->sdh, addr, size);
|
||||
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
|
||||
if (bcmsdh_regfail(bus->sdh))
|
||||
bcmerror = BCME_SDIO_ERROR;
|
||||
bcopy(&int_val, arg, sizeof(int32));
|
||||
bcopy(&int_val, arg, sizeof(s32));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2413,7 +2413,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
}
|
||||
|
||||
case IOV_GVAL(IOV_FORCEEVEN):
|
||||
int_val = (int32) forcealign;
|
||||
int_val = (s32) forcealign;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2422,7 +2422,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_TXBOUND):
|
||||
int_val = (int32) dhd_txbound;
|
||||
int_val = (s32) dhd_txbound;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2431,7 +2431,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_RXBOUND):
|
||||
int_val = (int32) dhd_rxbound;
|
||||
int_val = (s32) dhd_rxbound;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2440,7 +2440,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
break;
|
||||
|
||||
case IOV_GVAL(IOV_TXMINMAX):
|
||||
int_val = (int32) dhd_txminmax;
|
||||
int_val = (s32) dhd_txminmax;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2451,7 +2451,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
|
||||
|
||||
#ifdef SDTEST
|
||||
case IOV_GVAL(IOV_EXTLOOP):
|
||||
int_val = (int32) bus->ext_loop;
|
||||
int_val = (s32) bus->ext_loop;
|
||||
bcopy(&int_val, arg, val_size);
|
||||
break;
|
||||
|
||||
@ -2742,7 +2742,7 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
|
||||
/* If it was divisor change, read the new one */
|
||||
if (set && strcmp(name, "sd_divisor") == 0) {
|
||||
if (bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0,
|
||||
&bus->sd_divisor, sizeof(int32),
|
||||
&bus->sd_divisor, sizeof(s32),
|
||||
FALSE) != BCME_OK) {
|
||||
bus->sd_divisor = -1;
|
||||
DHD_ERROR(("%s: fail on %s get\n", __func__,
|
||||
@ -2755,7 +2755,7 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
|
||||
/* If it was a mode change, read the new one */
|
||||
if (set && strcmp(name, "sd_mode") == 0) {
|
||||
if (bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0,
|
||||
&bus->sd_mode, sizeof(int32),
|
||||
&bus->sd_mode, sizeof(s32),
|
||||
FALSE) != BCME_OK) {
|
||||
bus->sd_mode = -1;
|
||||
DHD_ERROR(("%s: fail on %s get\n", __func__,
|
||||
@ -2767,10 +2767,10 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
|
||||
}
|
||||
/* Similar check for blocksize change */
|
||||
if (set && strcmp(name, "sd_blocksize") == 0) {
|
||||
int32 fnum = 2;
|
||||
s32 fnum = 2;
|
||||
if (bcmsdh_iovar_op
|
||||
(bus->sdh, "sd_blocksize", &fnum, sizeof(int32),
|
||||
&bus->blocksize, sizeof(int32),
|
||||
(bus->sdh, "sd_blocksize", &fnum, sizeof(s32),
|
||||
&bus->blocksize, sizeof(s32),
|
||||
FALSE) != BCME_OK) {
|
||||
bus->blocksize = 0;
|
||||
DHD_ERROR(("%s: fail on %s get\n", __func__,
|
||||
@ -5442,7 +5442,7 @@ fail:
|
||||
|
||||
static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh)
|
||||
{
|
||||
int32 fnum;
|
||||
s32 fnum;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
@ -5464,12 +5464,12 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh)
|
||||
|
||||
/* ...and initialize clock/power states */
|
||||
bus->clkstate = CLK_SDONLY;
|
||||
bus->idletime = (int32) dhd_idletime;
|
||||
bus->idletime = (s32) dhd_idletime;
|
||||
bus->idleclock = DHD_IDLE_ACTIVE;
|
||||
|
||||
/* Query the SD clock speed */
|
||||
if (bcmsdh_iovar_op(sdh, "sd_divisor", NULL, 0,
|
||||
&bus->sd_divisor, sizeof(int32),
|
||||
&bus->sd_divisor, sizeof(s32),
|
||||
FALSE) != BCME_OK) {
|
||||
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_divisor"));
|
||||
bus->sd_divisor = -1;
|
||||
@ -5480,7 +5480,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh)
|
||||
|
||||
/* Query the SD bus mode */
|
||||
if (bcmsdh_iovar_op(sdh, "sd_mode", NULL, 0,
|
||||
&bus->sd_mode, sizeof(int32), FALSE) != BCME_OK) {
|
||||
&bus->sd_mode, sizeof(s32), FALSE) != BCME_OK) {
|
||||
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_mode"));
|
||||
bus->sd_mode = -1;
|
||||
} else {
|
||||
@ -5490,8 +5490,8 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh)
|
||||
|
||||
/* Query the F2 block size, set roundup accordingly */
|
||||
fnum = 2;
|
||||
if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(int32),
|
||||
&bus->blocksize, sizeof(int32), FALSE) != BCME_OK) {
|
||||
if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(s32),
|
||||
&bus->blocksize, sizeof(s32), FALSE) != BCME_OK) {
|
||||
bus->blocksize = 0;
|
||||
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_blocksize"));
|
||||
} else {
|
||||
@ -5503,7 +5503,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh)
|
||||
/* Query if bus module supports packet chaining,
|
||||
default to use if supported */
|
||||
if (bcmsdh_iovar_op(sdh, "sd_rxchain", NULL, 0,
|
||||
&bus->sd_rxchain, sizeof(int32),
|
||||
&bus->sd_rxchain, sizeof(s32),
|
||||
FALSE) != BCME_OK) {
|
||||
bus->sd_rxchain = FALSE;
|
||||
} else {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -158,13 +158,13 @@ struct wl_conf {
|
||||
u32 rts_threshold;
|
||||
u32 retry_short;
|
||||
u32 retry_long;
|
||||
int32 tx_power;
|
||||
s32 tx_power;
|
||||
struct ieee80211_channel channel;
|
||||
};
|
||||
|
||||
/* cfg80211 main event loop */
|
||||
struct wl_event_loop {
|
||||
int32(*handler[WLC_E_LAST]) (struct wl_priv *wl,
|
||||
s32(*handler[WLC_E_LAST]) (struct wl_priv *wl,
|
||||
struct net_device *ndev,
|
||||
const wl_event_msg_t *e, void *data);
|
||||
};
|
||||
@ -231,13 +231,13 @@ struct wl_profile {
|
||||
u8 bssid[ETHER_ADDR_LEN];
|
||||
struct wl_security sec;
|
||||
struct wl_ibss ibss;
|
||||
int32 band;
|
||||
s32 band;
|
||||
bool active;
|
||||
};
|
||||
|
||||
/* dongle iscan event loop */
|
||||
struct wl_iscan_eloop {
|
||||
int32(*handler[WL_SCAN_ERSULTS_LAST]) (struct wl_priv *wl);
|
||||
s32(*handler[WL_SCAN_ERSULTS_LAST]) (struct wl_priv *wl);
|
||||
};
|
||||
|
||||
/* dongle iscan controller */
|
||||
@ -246,8 +246,8 @@ struct wl_iscan_ctrl {
|
||||
struct timer_list timer;
|
||||
u32 timer_ms;
|
||||
u32 timer_on;
|
||||
int32 state;
|
||||
int32 pid;
|
||||
s32 state;
|
||||
s32 pid;
|
||||
struct semaphore sync;
|
||||
struct completion exited;
|
||||
struct wl_iscan_eloop el;
|
||||
@ -259,9 +259,9 @@ struct wl_iscan_ctrl {
|
||||
/* association inform */
|
||||
struct wl_connect_info {
|
||||
u8 *req_ie;
|
||||
int32 req_ie_len;
|
||||
s32 req_ie_len;
|
||||
u8 *resp_ie;
|
||||
int32 resp_ie_len;
|
||||
s32 resp_ie_len;
|
||||
};
|
||||
|
||||
/* firmware /nvram downloading controller */
|
||||
@ -315,7 +315,7 @@ struct wl_priv {
|
||||
struct wl_fw_ctrl *fw; /* control firwmare / nvram paramter
|
||||
downloading */
|
||||
struct wl_pmk_list *pmk_list; /* wpa2 pmk list */
|
||||
int32 event_pid; /* pid of main event handler thread */
|
||||
s32 event_pid; /* pid of main event handler thread */
|
||||
unsigned long status; /* current dongle status */
|
||||
void *pub;
|
||||
u32 channel; /* current channel */
|
||||
@ -360,20 +360,20 @@ static inline struct wl_bss_info *next_bss(struct wl_scan_results *list,
|
||||
#define for_each_bss(list, bss, __i) \
|
||||
for (__i = 0; __i < list->count && __i < WL_AP_MAX; __i++, bss = next_bss(list, bss))
|
||||
|
||||
extern int32 wl_cfg80211_attach(struct net_device *ndev, void *data);
|
||||
extern s32 wl_cfg80211_attach(struct net_device *ndev, void *data);
|
||||
extern void wl_cfg80211_detach(void);
|
||||
/* event handler from dongle */
|
||||
extern void wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t *e,
|
||||
void *data);
|
||||
extern void wl_cfg80211_sdio_func(void *func); /* set sdio function info */
|
||||
extern struct sdio_func *wl_cfg80211_get_sdio_func(void); /* set sdio function info */
|
||||
extern int32 wl_cfg80211_up(void); /* dongle up */
|
||||
extern int32 wl_cfg80211_down(void); /* dongle down */
|
||||
extern s32 wl_cfg80211_up(void); /* dongle up */
|
||||
extern s32 wl_cfg80211_down(void); /* dongle down */
|
||||
extern void wl_cfg80211_dbg_level(u32 level); /* set dongle
|
||||
debugging level */
|
||||
extern void *wl_cfg80211_request_fw(s8 *file_name); /* request fw /nvram
|
||||
downloading */
|
||||
extern int32 wl_cfg80211_read_fw(s8 *buf, u32 size); /* read fw
|
||||
extern s32 wl_cfg80211_read_fw(s8 *buf, u32 size); /* read fw
|
||||
image */
|
||||
extern void wl_cfg80211_release_fw(void); /* release fw */
|
||||
extern s8 *wl_cfg80211_get_fwname(void); /* get firmware name for
|
||||
|
@ -2222,7 +2222,7 @@ wl_iw_get_txpow(struct net_device *dev,
|
||||
|
||||
disable = dtoh32(disable);
|
||||
result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE);
|
||||
vwrq->value = (int32) bcm_qdbm_to_mw(result);
|
||||
vwrq->value = (s32) bcm_qdbm_to_mw(result);
|
||||
vwrq->fixed = 0;
|
||||
vwrq->disabled =
|
||||
(disable & (WL_RADIO_SW_DISABLE | WL_RADIO_HW_DISABLE)) ? 1 : 0;
|
||||
|
@ -35,8 +35,8 @@ void bcm_xdr_buf_init(bcm_xdr_buf_t *b, void *buf, size_t len);
|
||||
|
||||
int bcm_xdr_pack_u32(bcm_xdr_buf_t *b, u32 val);
|
||||
int bcm_xdr_unpack_u32(bcm_xdr_buf_t *b, u32 *pval);
|
||||
int bcm_xdr_pack_int32(bcm_xdr_buf_t *b, int32 val);
|
||||
int bcm_xdr_unpack_int32(bcm_xdr_buf_t *b, int32 *pval);
|
||||
int bcm_xdr_pack_s32(bcm_xdr_buf_t *b, s32 val);
|
||||
int bcm_xdr_unpack_s32(bcm_xdr_buf_t *b, s32 *pval);
|
||||
int bcm_xdr_pack_s8(bcm_xdr_buf_t *b, s8 val);
|
||||
int bcm_xdr_unpack_s8(bcm_xdr_buf_t *b, s8 *pval);
|
||||
int bcm_xdr_pack_opaque(bcm_xdr_buf_t *b, uint len, void *data);
|
||||
|
@ -94,8 +94,8 @@ extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
|
||||
*/
|
||||
|
||||
/* Register mapping routines */
|
||||
extern u32 *sdioh_sdmmc_reg_map(osl_t *osh, int32 addr, int size);
|
||||
extern void sdioh_sdmmc_reg_unmap(osl_t *osh, int32 addr, int size);
|
||||
extern u32 *sdioh_sdmmc_reg_map(osl_t *osh, s32 addr, int size);
|
||||
extern void sdioh_sdmmc_reg_unmap(osl_t *osh, s32 addr, int size);
|
||||
|
||||
/* Interrupt (de)registration routines */
|
||||
extern int sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq);
|
||||
|
@ -326,7 +326,7 @@ extern "C" {
|
||||
"u8", \
|
||||
"s16", \
|
||||
"u16", \
|
||||
"int32", \
|
||||
"s32", \
|
||||
"u32", \
|
||||
"buffer", \
|
||||
"" }
|
||||
|
@ -19,31 +19,31 @@
|
||||
|
||||
#include <typedefs.h>
|
||||
|
||||
s16 qm_sat32(int32 op);
|
||||
s16 qm_sat32(s32 op);
|
||||
|
||||
int32 qm_mul321616(s16 op1, s16 op2);
|
||||
s32 qm_mul321616(s16 op1, s16 op2);
|
||||
|
||||
s16 qm_mul16(s16 op1, s16 op2);
|
||||
|
||||
int32 qm_muls321616(s16 op1, s16 op2);
|
||||
s32 qm_muls321616(s16 op1, s16 op2);
|
||||
|
||||
u16 qm_mulu16(u16 op1, u16 op2);
|
||||
|
||||
s16 qm_muls16(s16 op1, s16 op2);
|
||||
|
||||
int32 qm_add32(int32 op1, int32 op2);
|
||||
s32 qm_add32(s32 op1, s32 op2);
|
||||
|
||||
s16 qm_add16(s16 op1, s16 op2);
|
||||
|
||||
s16 qm_sub16(s16 op1, s16 op2);
|
||||
|
||||
int32 qm_sub32(int32 op1, int32 op2);
|
||||
s32 qm_sub32(s32 op1, s32 op2);
|
||||
|
||||
int32 qm_mac321616(int32 acc, s16 op1, s16 op2);
|
||||
s32 qm_mac321616(s32 acc, s16 op1, s16 op2);
|
||||
|
||||
int32 qm_shl32(int32 op, int shift);
|
||||
s32 qm_shl32(s32 op, int shift);
|
||||
|
||||
int32 qm_shr32(int32 op, int shift);
|
||||
s32 qm_shr32(s32 op, int shift);
|
||||
|
||||
s16 qm_shl16(s16 op, int shift);
|
||||
|
||||
@ -51,7 +51,7 @@ s16 qm_shr16(s16 op, int shift);
|
||||
|
||||
s16 qm_norm16(s16 op);
|
||||
|
||||
s16 qm_norm32(int32 op);
|
||||
s16 qm_norm32(s32 op);
|
||||
|
||||
s16 qm_div_s(s16 num, s16 denom);
|
||||
|
||||
@ -59,22 +59,22 @@ s16 qm_abs16(s16 op);
|
||||
|
||||
s16 qm_div16(s16 num, s16 denom, s16 *qQuotient);
|
||||
|
||||
int32 qm_abs32(int32 op);
|
||||
s32 qm_abs32(s32 op);
|
||||
|
||||
s16 qm_div163232(int32 num, int32 denom, s16 *qquotient);
|
||||
s16 qm_div163232(s32 num, s32 denom, s16 *qquotient);
|
||||
|
||||
int32 qm_mul323216(int32 op1, s16 op2);
|
||||
s32 qm_mul323216(s32 op1, s16 op2);
|
||||
|
||||
int32 qm_mulsu321616(s16 op1, u16 op2);
|
||||
s32 qm_mulsu321616(s16 op1, u16 op2);
|
||||
|
||||
int32 qm_muls323216(int32 op1, s16 op2);
|
||||
s32 qm_muls323216(s32 op1, s16 op2);
|
||||
|
||||
int32 qm_mul32(int32 a, int32 b);
|
||||
s32 qm_mul32(s32 a, s32 b);
|
||||
|
||||
int32 qm_muls32(int32 a, int32 b);
|
||||
s32 qm_muls32(s32 a, s32 b);
|
||||
|
||||
void qm_log10(int32 N, s16 qN, s16 *log10N, s16 *qLog10N);
|
||||
void qm_log10(s32 N, s16 qN, s16 *log10N, s16 *qLog10N);
|
||||
|
||||
void qm_1byN(int32 N, s16 qN, int32 *result, s16 *qResult);
|
||||
void qm_1byN(s32 N, s16 qN, s32 *result, s16 *qResult);
|
||||
|
||||
#endif /* #ifndef __QMATH_H__ */
|
||||
|
@ -42,16 +42,10 @@ typedef unsigned long long int uintptr;
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
|
||||
/* define [u]int32/64, uintptr */
|
||||
|
||||
#ifndef TYPEDEF_UINTPTR
|
||||
typedef unsigned int uintptr;
|
||||
#endif
|
||||
|
||||
#ifndef TYPEDEF_INT32
|
||||
typedef signed int int32;
|
||||
#endif
|
||||
|
||||
/* define macro values */
|
||||
|
||||
#ifndef FALSE
|
||||
@ -74,7 +68,6 @@ typedef signed int int32;
|
||||
|
||||
#undef TYPEDEF_UINT
|
||||
#undef TYPEDEF_UINTPTR
|
||||
#undef TYPEDEF_INT32
|
||||
|
||||
/*
|
||||
* Including the bcmdefs.h here, to make sure everyone including typedefs.h
|
||||
|
@ -183,7 +183,7 @@ typedef struct wl_extdscan_params {
|
||||
wlc_ssid_t ssid[WLC_EXTDSCAN_MAX_SSID]; /* ssid list */
|
||||
u32 tx_rate; /* in 500ksec units */
|
||||
wl_scan_type_t scan_type; /* enum */
|
||||
int32 channel_num;
|
||||
s32 channel_num;
|
||||
chan_scandata_t channel_list[1]; /* list of chandata structs */
|
||||
} wl_extdscan_params_t;
|
||||
|
||||
@ -205,23 +205,23 @@ typedef struct wl_scan_params {
|
||||
* DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
|
||||
*/
|
||||
u8 scan_type; /* flags, 0 use default */
|
||||
int32 nprobes; /* -1 use default, number of probes per channel */
|
||||
int32 active_time; /* -1 use default, dwell time per channel for
|
||||
s32 nprobes; /* -1 use default, number of probes per channel */
|
||||
s32 active_time; /* -1 use default, dwell time per channel for
|
||||
* active scanning
|
||||
*/
|
||||
int32 passive_time; /* -1 use default, dwell time per channel
|
||||
s32 passive_time; /* -1 use default, dwell time per channel
|
||||
* for passive scanning
|
||||
*/
|
||||
int32 home_time; /* -1 use default, dwell time for the home channel
|
||||
s32 home_time; /* -1 use default, dwell time for the home channel
|
||||
* between channel scans
|
||||
*/
|
||||
int32 channel_num; /* count of channels and ssids that follow
|
||||
s32 channel_num; /* count of channels and ssids that follow
|
||||
*
|
||||
* low half is count of channels in channel_list, 0
|
||||
* means default (use all available channels)
|
||||
*
|
||||
* high half is entries in wlc_ssid_t array that
|
||||
* follows channel_list, aligned for int32 (4 bytes)
|
||||
* follows channel_list, aligned for s32 (4 bytes)
|
||||
* meaning an odd channel count implies a 2-byte pad
|
||||
* between end of channel_list and first ssid
|
||||
*
|
||||
@ -333,7 +333,7 @@ typedef struct wl_u32_list {
|
||||
/* used for association with a specific BSSID and chanspec list */
|
||||
typedef struct wl_assoc_params {
|
||||
struct ether_addr bssid; /* 00:00:00:00:00:00: broadcast scan */
|
||||
int32 chanspec_num; /* 0: all available channels,
|
||||
s32 chanspec_num; /* 0: all available channels,
|
||||
* otherwise count of chanspecs in chanspec_list
|
||||
*/
|
||||
chanspec_t chanspec_list[1]; /* list of chanspecs */
|
||||
@ -435,7 +435,7 @@ typedef struct wl_country {
|
||||
char country_abbrev[WLC_CNTRY_BUF_SZ]; /* nul-terminated country code used in
|
||||
* the Country IE
|
||||
*/
|
||||
int32 rev; /* revision specifier for ccode
|
||||
s32 rev; /* revision specifier for ccode
|
||||
* on set, -1 indicates unspecified.
|
||||
* on get, rev >= 0
|
||||
*/
|
||||
|
@ -1782,8 +1782,8 @@ wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan, u8 *max_txpwr,
|
||||
}
|
||||
|
||||
void
|
||||
wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint bandunit, int32 *max_pwr,
|
||||
int32 *min_pwr, u32 *step_pwr)
|
||||
wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint bandunit, s32 *max_pwr,
|
||||
s32 *min_pwr, u32 *step_pwr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -2748,7 +2748,7 @@ void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
|
||||
if (ISLCNPHY(pi)) {
|
||||
u32 cmplx_pwr, cmplx_pwr0, cmplx_pwr1;
|
||||
u16 lo, hi;
|
||||
int32 pwr_offset_dB, gain_dB;
|
||||
s32 pwr_offset_dB, gain_dB;
|
||||
u16 status_0, status_1;
|
||||
|
||||
jssi_aux = wlapi_bmac_read_shm(pi->sh->physhim, M_JSSI_AUX);
|
||||
@ -3021,7 +3021,7 @@ void wlc_phy_BSSinit(wlc_phy_t *pih, bool bonlyap, int rssi)
|
||||
}
|
||||
|
||||
void
|
||||
wlc_phy_papd_decode_epsilon(u32 epsilon, int32 *eps_real, int32 *eps_imag)
|
||||
wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag)
|
||||
{
|
||||
*eps_imag = (epsilon >> 13);
|
||||
if (*eps_imag > 0xfff)
|
||||
@ -3053,7 +3053,7 @@ static const fixed AtanTbl[] = {
|
||||
29
|
||||
};
|
||||
|
||||
void wlc_phy_cordic(fixed theta, cint32 *val)
|
||||
void wlc_phy_cordic(fixed theta, cs32 *val)
|
||||
{
|
||||
fixed angle, valtmp;
|
||||
unsigned iter;
|
||||
@ -3207,9 +3207,9 @@ void wlc_phy_cal_perical_mphase_restart(phy_info_t *pi)
|
||||
pi->mphase_txcal_cmdidx = 0;
|
||||
}
|
||||
|
||||
u8 wlc_phy_nbits(int32 value)
|
||||
u8 wlc_phy_nbits(s32 value)
|
||||
{
|
||||
int32 abs_val;
|
||||
s32 abs_val;
|
||||
u8 nbits = 0;
|
||||
|
||||
abs_val = ABS(value);
|
||||
|
@ -204,8 +204,8 @@ extern void wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint chan,
|
||||
u8 *_min_, u8 *_max_, int rate);
|
||||
extern void wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan,
|
||||
u8 *_max_, u8 *_min_);
|
||||
extern void wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint band, int32 *,
|
||||
int32 *, u32 *);
|
||||
extern void wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint band, s32 *,
|
||||
s32 *, u32 *);
|
||||
extern void wlc_phy_txpower_limit_set(wlc_phy_t *ppi, struct txpwr_limits *,
|
||||
chanspec_t chanspec);
|
||||
extern int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override);
|
||||
|
@ -51,7 +51,7 @@ typedef void (*txiqccsetfn_t) (phy_info_t *, u16, u16);
|
||||
typedef u16(*txloccgetfn_t) (phy_info_t *);
|
||||
typedef void (*radioloftgetfn_t) (phy_info_t *, u8 *, u8 *, u8 *,
|
||||
u8 *);
|
||||
typedef int32(*rxsigpwrfn_t) (phy_info_t *, int32);
|
||||
typedef s32(*rxsigpwrfn_t) (phy_info_t *, s32);
|
||||
typedef void (*detachfn_t) (phy_info_t *);
|
||||
|
||||
#undef ISNPHY
|
||||
@ -241,7 +241,7 @@ typedef enum {
|
||||
|
||||
#define CORDIC_AG 39797
|
||||
#define CORDIC_NI 18
|
||||
#define FIXED(X) ((int32)((X) << 16))
|
||||
#define FIXED(X) ((s32)((X) << 16))
|
||||
#define FLOAT(X) (((X) >= 0) ? ((((X) >> 15) + 1) >> 1) : -((((-(X)) >> 15) + 1) >> 1))
|
||||
|
||||
#define PHY_CHAIN_TX_DISABLE_TEMP 115
|
||||
@ -939,12 +939,12 @@ struct phy_info {
|
||||
u32 mcs40_po;
|
||||
};
|
||||
|
||||
typedef int32 fixed;
|
||||
typedef s32 fixed;
|
||||
|
||||
typedef struct _cint32 {
|
||||
typedef struct _cs32 {
|
||||
fixed q;
|
||||
fixed i;
|
||||
} cint32;
|
||||
} cs32;
|
||||
|
||||
typedef struct radio_regs {
|
||||
u16 address;
|
||||
@ -1023,8 +1023,8 @@ extern void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val);
|
||||
extern void write_phy_channel_reg(phy_info_t *pi, uint val);
|
||||
extern void wlc_phy_txpower_update_shm(phy_info_t *pi);
|
||||
|
||||
extern void wlc_phy_cordic(fixed theta, cint32 *val);
|
||||
extern u8 wlc_phy_nbits(int32 value);
|
||||
extern void wlc_phy_cordic(fixed theta, cs32 *val);
|
||||
extern u8 wlc_phy_nbits(s32 value);
|
||||
extern u32 wlc_phy_sqrt_int(u32 value);
|
||||
extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
|
||||
|
||||
@ -1036,8 +1036,8 @@ extern uint wlc_phy_init_radio_regs(phy_info_t *pi, radio_regs_t *radioregs,
|
||||
extern void wlc_phy_txpower_ipa_upd(phy_info_t *pi);
|
||||
|
||||
extern void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on);
|
||||
extern void wlc_phy_papd_decode_epsilon(u32 epsilon, int32 *eps_real,
|
||||
int32 *eps_imag);
|
||||
extern void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real,
|
||||
s32 *eps_imag);
|
||||
|
||||
extern void wlc_phy_cal_perical_mphase_reset(phy_info_t *pi);
|
||||
extern void wlc_phy_cal_perical_mphase_restart(phy_info_t *pi);
|
||||
@ -1071,7 +1071,7 @@ extern void wlc_phy_txpower_recalc_target_lcnphy(phy_info_t *pi);
|
||||
extern void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index);
|
||||
extern void wlc_lcnphy_tx_pu(phy_info_t *pi, bool bEnable);
|
||||
extern void wlc_lcnphy_stop_tx_tone(phy_info_t *pi);
|
||||
extern void wlc_lcnphy_start_tx_tone(phy_info_t *pi, int32 f_kHz,
|
||||
extern void wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz,
|
||||
u16 max_val, bool iqcalmode);
|
||||
|
||||
extern void wlc_phy_txpower_sromlimit_get_nphy(phy_info_t *pi, uint chan,
|
||||
@ -1121,18 +1121,18 @@ extern void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode);
|
||||
extern void wlc_lcnphy_deaf_mode(phy_info_t *pi, bool mode);
|
||||
extern bool wlc_phy_tpc_isenabled_lcnphy(phy_info_t *pi);
|
||||
extern void wlc_lcnphy_tx_pwr_update_npt(phy_info_t *pi);
|
||||
extern int32 wlc_lcnphy_tssi2dbm(int32 tssi, int32 a1, int32 b0, int32 b1);
|
||||
extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
|
||||
extern void wlc_lcnphy_get_tssi(phy_info_t *pi, s8 *ofdm_pwr,
|
||||
s8 *cck_pwr);
|
||||
extern void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi);
|
||||
|
||||
extern int32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, int32 gain_index);
|
||||
extern s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index);
|
||||
|
||||
#define NPHY_MAX_HPVGA1_INDEX 10
|
||||
#define NPHY_DEF_HPVGA1_INDEXLIMIT 7
|
||||
|
||||
typedef struct _phy_iq_est {
|
||||
int32 iq_prod;
|
||||
s32 iq_prod;
|
||||
u32 i_pwr;
|
||||
u32 q_pwr;
|
||||
} phy_iq_est_t;
|
||||
@ -1201,15 +1201,15 @@ extern void wlc_phy_txpwr_index_nphy(phy_info_t *pi, u8 core_mask,
|
||||
s8 txpwrindex, bool res);
|
||||
extern void wlc_phy_rssisel_nphy(phy_info_t *pi, u8 core, u8 rssi_type);
|
||||
extern int wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type,
|
||||
int32 *rssi_buf, u8 nsamps);
|
||||
s32 *rssi_buf, u8 nsamps);
|
||||
extern void wlc_phy_rssi_cal_nphy(phy_info_t *pi);
|
||||
extern int wlc_phy_aci_scan_nphy(phy_info_t *pi);
|
||||
extern void wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, int32 dBm_targetpower,
|
||||
extern void wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, s32 dBm_targetpower,
|
||||
bool debug);
|
||||
extern int wlc_phy_tx_tone_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
|
||||
u8 mode, u8, bool);
|
||||
extern void wlc_phy_stopplayback_nphy(phy_info_t *pi);
|
||||
extern void wlc_phy_est_tonepwr_nphy(phy_info_t *pi, int32 *qdBm_pwrbuf,
|
||||
extern void wlc_phy_est_tonepwr_nphy(phy_info_t *pi, s32 *qdBm_pwrbuf,
|
||||
u8 num_samps);
|
||||
extern void wlc_phy_radio205x_vcocal_nphy(phy_info_t *pi);
|
||||
|
||||
|
@ -1591,9 +1591,9 @@ void wlc_lcnphy_tx_pwr_update_npt(phy_info_t *pi)
|
||||
}
|
||||
}
|
||||
|
||||
int32 wlc_lcnphy_tssi2dbm(int32 tssi, int32 a1, int32 b0, int32 b1)
|
||||
s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1)
|
||||
{
|
||||
int32 a, b, p;
|
||||
s32 a, b, p;
|
||||
|
||||
a = 32768 + (a1 * tssi);
|
||||
b = (1024 * b0) + (64 * b1 * tssi);
|
||||
@ -1626,7 +1626,7 @@ void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi)
|
||||
if (i == WLC_NUM_RATES_CCK + WLC_NUM_RATES_OFDM)
|
||||
j = TXP_FIRST_MCS_20_SISO;
|
||||
|
||||
rate_table[i] = (u32) ((int32) (-pi->tx_power_offset[j]));
|
||||
rate_table[i] = (u32) ((s32) (-pi->tx_power_offset[j]));
|
||||
}
|
||||
|
||||
tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL;
|
||||
@ -2295,8 +2295,8 @@ void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
|
||||
lcnphy_txgains_t tx_gains;
|
||||
u8 bbmult;
|
||||
phytbl_info_t tab;
|
||||
int32 a1, b0, b1;
|
||||
int32 tssi, pwr, maxtargetpwr, mintargetpwr;
|
||||
s32 a1, b0, b1;
|
||||
s32 tssi, pwr, maxtargetpwr, mintargetpwr;
|
||||
bool suspend;
|
||||
phy_info_t *pi = (phy_info_t *) ppi;
|
||||
|
||||
@ -2729,14 +2729,14 @@ void wlc_lcnphy_deaf_mode(phy_info_t *pi, bool mode)
|
||||
}
|
||||
|
||||
void
|
||||
wlc_lcnphy_start_tx_tone(phy_info_t *pi, int32 f_kHz, u16 max_val,
|
||||
wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
|
||||
bool iqcalmode)
|
||||
{
|
||||
u8 phy_bw;
|
||||
u16 num_samps, t, k;
|
||||
u32 bw;
|
||||
fixed theta = 0, rot = 0;
|
||||
cint32 tone_samp;
|
||||
cs32 tone_samp;
|
||||
u32 data_buf[64];
|
||||
u16 i_samp, q_samp;
|
||||
phytbl_info_t tab;
|
||||
@ -3023,7 +3023,7 @@ s16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode)
|
||||
u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
|
||||
{
|
||||
u16 tempsenseval1, tempsenseval2;
|
||||
int32 avg = 0;
|
||||
s32 avg = 0;
|
||||
bool suspend = 0;
|
||||
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
|
||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||
@ -3083,7 +3083,7 @@ u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
|
||||
|
||||
s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode)
|
||||
{
|
||||
int32 degree = wlc_lcnphy_tempsense_new(pi, mode);
|
||||
s32 degree = wlc_lcnphy_tempsense_new(pi, mode);
|
||||
degree =
|
||||
((degree << 10) + LCN_TEMPSENSE_OFFSET + (LCN_TEMPSENSE_DEN >> 1))
|
||||
/ LCN_TEMPSENSE_DEN;
|
||||
@ -3093,7 +3093,7 @@ s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode)
|
||||
s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode)
|
||||
{
|
||||
u16 vbatsenseval;
|
||||
int32 avg = 0;
|
||||
s32 avg = 0;
|
||||
bool suspend = 0;
|
||||
|
||||
if (NORADIO_ENAB(pi->pubpi))
|
||||
@ -3111,9 +3111,9 @@ s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode)
|
||||
vbatsenseval = read_phy_reg(pi, 0x475) & 0x1FF;
|
||||
|
||||
if (vbatsenseval > 255)
|
||||
avg = (int32) (vbatsenseval - 512);
|
||||
avg = (s32) (vbatsenseval - 512);
|
||||
else
|
||||
avg = (int32) vbatsenseval;
|
||||
avg = (s32) vbatsenseval;
|
||||
|
||||
avg =
|
||||
(avg * LCN_VBAT_SCALE_NOM +
|
||||
@ -3193,9 +3193,9 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
|
||||
bool result;
|
||||
u16 a0_new, b0_new;
|
||||
lcnphy_iq_est_t iq_est = { 0, 0, 0 };
|
||||
int32 a, b, temp;
|
||||
s32 a, b, temp;
|
||||
s16 iq_nbits, qq_nbits, arsh, brsh;
|
||||
int32 iq;
|
||||
s32 iq;
|
||||
u32 ii, qq;
|
||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||
|
||||
@ -3211,7 +3211,7 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
|
||||
if (!result)
|
||||
goto cleanup;
|
||||
|
||||
iq = (int32) iq_est.iq_prod;
|
||||
iq = (s32) iq_est.iq_prod;
|
||||
ii = iq_est.i_pwr;
|
||||
qq = iq_est.q_pwr;
|
||||
|
||||
@ -3226,13 +3226,13 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
|
||||
arsh = 10 - (30 - iq_nbits);
|
||||
if (arsh >= 0) {
|
||||
a = (-(iq << (30 - iq_nbits)) + (ii >> (1 + arsh)));
|
||||
temp = (int32) (ii >> arsh);
|
||||
temp = (s32) (ii >> arsh);
|
||||
if (temp == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
a = (-(iq << (30 - iq_nbits)) + (ii << (-1 - arsh)));
|
||||
temp = (int32) (ii << -arsh);
|
||||
temp = (s32) (ii << -arsh);
|
||||
if (temp == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
@ -3241,20 +3241,20 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
|
||||
brsh = qq_nbits - 31 + 20;
|
||||
if (brsh >= 0) {
|
||||
b = (qq << (31 - qq_nbits));
|
||||
temp = (int32) (ii >> brsh);
|
||||
temp = (s32) (ii >> brsh);
|
||||
if (temp == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
b = (qq << (31 - qq_nbits));
|
||||
temp = (int32) (ii << -brsh);
|
||||
temp = (s32) (ii << -brsh);
|
||||
if (temp == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
b /= temp;
|
||||
b -= a * a;
|
||||
b = (int32) wlc_phy_sqrt_int((u32) b);
|
||||
b = (s32) wlc_phy_sqrt_int((u32) b);
|
||||
b -= (1 << 10);
|
||||
a0_new = (u16) (a & 0x3ff);
|
||||
b0_new = (u16) (b & 0x3ff);
|
||||
@ -3483,8 +3483,8 @@ static void wlc_lcnphy_periodic_cal(phy_info_t *pi)
|
||||
u16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
|
||||
s8 index;
|
||||
phytbl_info_t tab;
|
||||
int32 a1, b0, b1;
|
||||
int32 tssi, pwr, maxtargetpwr, mintargetpwr;
|
||||
s32 a1, b0, b1;
|
||||
s32 tssi, pwr, maxtargetpwr, mintargetpwr;
|
||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||
|
||||
if (NORADIO_ENAB(pi->pubpi))
|
||||
@ -4038,7 +4038,7 @@ wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
|
||||
u16 phy_c7, phy_c8, phy_c9;
|
||||
s16 phy_c10, phy_c11, phy_c12, phy_c13, phy_c14, phy_c15, phy_c16;
|
||||
s16 *ptr, phy_c17;
|
||||
int32 phy_c18, phy_c19;
|
||||
s32 phy_c18, phy_c19;
|
||||
u32 phy_c20, phy_c21;
|
||||
bool phy_c22, phy_c23, phy_c24, phy_c25;
|
||||
u16 phy_c26, phy_c27;
|
||||
@ -4299,8 +4299,8 @@ static void wlc_lcnphy_load_rfpower(phy_info_t *pi)
|
||||
tab.tbl_offset = LCNPHY_TX_PWR_CTRL_GAIN_OFFSET + index;
|
||||
wlc_lcnphy_read_table(pi, &tab);
|
||||
|
||||
qm_log10((int32) (bbmult), 0, &temp1, &qQ1);
|
||||
qm_log10((int32) (1 << 6), 0, &temp2, &qQ2);
|
||||
qm_log10((s32) (bbmult), 0, &temp1, &qQ1);
|
||||
qm_log10((s32) (1 << 6), 0, &temp2, &qQ2);
|
||||
|
||||
if (qQ1 < qQ2) {
|
||||
temp2 = qm_shr16(temp2, qQ2 - qQ1);
|
||||
@ -5141,10 +5141,10 @@ static void wlc_lcnphy_set_rx_gain(phy_info_t *pi, u32 gain)
|
||||
wlc_lcnphy_rx_gain_override_enable(pi, TRUE);
|
||||
}
|
||||
|
||||
static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, int32 *gain_index)
|
||||
static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, s32 *gain_index)
|
||||
{
|
||||
u32 received_power = 0;
|
||||
int32 max_index = 0;
|
||||
s32 max_index = 0;
|
||||
u32 gain_code = 0;
|
||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||
|
||||
@ -5154,7 +5154,7 @@ static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, int32 *gain_index)
|
||||
|
||||
if (-1 == *gain_index) {
|
||||
*gain_index = 0;
|
||||
while ((*gain_index <= (int32) max_index)
|
||||
while ((*gain_index <= (s32) max_index)
|
||||
&& (received_power < 700)) {
|
||||
wlc_lcnphy_set_rx_gain(pi,
|
||||
lcnphy_23bitgaincode_table
|
||||
@ -5177,13 +5177,13 @@ static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, int32 *gain_index)
|
||||
return received_power;
|
||||
}
|
||||
|
||||
int32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, int32 gain_index)
|
||||
s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index)
|
||||
{
|
||||
int32 gain = 0;
|
||||
int32 nominal_power_db;
|
||||
int32 log_val, gain_mismatch, desired_gain, input_power_offset_db,
|
||||
s32 gain = 0;
|
||||
s32 nominal_power_db;
|
||||
s32 log_val, gain_mismatch, desired_gain, input_power_offset_db,
|
||||
input_power_db;
|
||||
int32 received_power, temperature;
|
||||
s32 received_power, temperature;
|
||||
uint freq;
|
||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||
|
||||
|
@ -93,7 +93,7 @@ struct phy_info_lcnphy {
|
||||
u8 lcnphy_lowerofdm;
|
||||
u8 lcnphy_cck;
|
||||
u8 lcnphy_psat_2pt3_detected;
|
||||
int32 lcnphy_lowest_Re_div_Im;
|
||||
s32 lcnphy_lowest_Re_div_Im;
|
||||
s8 lcnphy_final_papd_cal_idx;
|
||||
u16 lcnphy_extstxctrl4;
|
||||
u16 lcnphy_extstxctrl0;
|
||||
@ -104,7 +104,7 @@ struct phy_info_lcnphy {
|
||||
|
||||
u8 lcnphy_psat_pwr;
|
||||
u8 lcnphy_psat_indx;
|
||||
int32 lcnphy_min_phase;
|
||||
s32 lcnphy_min_phase;
|
||||
u8 lcnphy_final_idx;
|
||||
u8 lcnphy_start_idx;
|
||||
u8 lcnphy_current_index;
|
||||
|
@ -13281,8 +13281,8 @@ radio_20xx_regs_t regs_2057_rev8[] = {
|
||||
|
||||
static s16 nphy_def_lnagains[] = { -2, 10, 19, 25 };
|
||||
|
||||
static int32 nphy_lnagain_est0[] = { -315, 40370 };
|
||||
static int32 nphy_lnagain_est1[] = { -224, 23242 };
|
||||
static s32 nphy_lnagain_est0[] = { -315, 40370 };
|
||||
static s32 nphy_lnagain_est1[] = { -224, 23242 };
|
||||
|
||||
static const u16 tbl_iqcal_gainparams_nphy[2][NPHY_IQCAL_NUMGAINS][8] = {
|
||||
{
|
||||
@ -14118,7 +14118,7 @@ static int wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, nphy_txgains_t tg,
|
||||
u8 type, bool d);
|
||||
static void wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rxcore,
|
||||
u16 *rg, u8 type);
|
||||
static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, int32 preamble);
|
||||
static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, s32 preamble);
|
||||
static void wlc_phy_savecal_nphy(phy_info_t *pi);
|
||||
static void wlc_phy_restorecal_nphy(phy_info_t *pi);
|
||||
static void wlc_phy_resetcca_nphy(phy_info_t *pi);
|
||||
@ -14184,7 +14184,7 @@ static u16 wlc_phy_radio2057_rccal(phy_info_t *pi);
|
||||
static u16 wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz,
|
||||
u16 max_val,
|
||||
u8 dac_test_mode);
|
||||
static void wlc_phy_loadsampletable_nphy(phy_info_t *pi, cint32 *tone_buf,
|
||||
static void wlc_phy_loadsampletable_nphy(phy_info_t *pi, cs32 *tone_buf,
|
||||
u16 num_samps);
|
||||
static void wlc_phy_runsamples_nphy(phy_info_t *pi, u16 n, u16 lps,
|
||||
u16 wait, u8 iq, u8 dac_test_mode,
|
||||
@ -14707,7 +14707,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
|
||||
u16 idx;
|
||||
s16 pga_gn = 0;
|
||||
s16 pad_gn = 0;
|
||||
int32 rfpwr_offset = 0;
|
||||
s32 rfpwr_offset = 0;
|
||||
|
||||
if (PHY_IPA(pi)) {
|
||||
tx_pwrctrl_tbl = wlc_phy_get_ipa_gaintbl_nphy(pi);
|
||||
@ -14938,7 +14938,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
|
||||
|
||||
}
|
||||
|
||||
static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, int32 preamble)
|
||||
static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, s32 preamble)
|
||||
{
|
||||
bool gf_preamble = FALSE;
|
||||
u16 val;
|
||||
@ -15345,8 +15345,8 @@ static void wlc_phy_workarounds_nphy(phy_info_t *pi)
|
||||
u16 *aux_adc_gain;
|
||||
u16 sk_adc_vmid[] = { 0xb4, 0xb4, 0xb4, 0x24 };
|
||||
u16 sk_adc_gain[] = { 0x02, 0x02, 0x02, 0x02 };
|
||||
int32 min_nvar_val = 0x18d;
|
||||
int32 min_nvar_offset_6mbps = 20;
|
||||
s32 min_nvar_val = 0x18d;
|
||||
s32 min_nvar_offset_6mbps = 20;
|
||||
u8 pdetrange;
|
||||
u8 triso;
|
||||
u16 regval;
|
||||
@ -20809,7 +20809,7 @@ void wlc_phy_rssisel_nphy(phy_info_t *pi, u8 core_code, u8 rssi_type)
|
||||
}
|
||||
|
||||
int
|
||||
wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type, int32 *rssi_buf,
|
||||
wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type, s32 *rssi_buf,
|
||||
u8 nsamps)
|
||||
{
|
||||
s16 rssi0, rssi1;
|
||||
@ -20827,7 +20827,7 @@ wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type, int32 *rssi_buf,
|
||||
u16 rfctrlrssiothers2_save = 0;
|
||||
s8 tmp_buf[4];
|
||||
u8 ctr = 0, samp = 0;
|
||||
int32 rssi_out_val;
|
||||
s32 rssi_out_val;
|
||||
u16 gpiosel_orig;
|
||||
|
||||
afectrlCore1_save = read_phy_reg(pi, 0xa6);
|
||||
@ -20920,8 +20920,8 @@ s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
|
||||
u16 afectrlOverride2_save;
|
||||
u16 pd_pll_ts_save;
|
||||
u16 gpioSel_save;
|
||||
int32 radio_temp[4];
|
||||
int32 radio_temp2[4];
|
||||
s32 radio_temp[4];
|
||||
s32 radio_temp2[4];
|
||||
u16 syn_tempprocsense_save;
|
||||
s16 offset = 0;
|
||||
|
||||
@ -20929,7 +20929,7 @@ s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
|
||||
u16 auxADC_Vmid, auxADC_Av, auxADC_Vmid_save, auxADC_Av_save;
|
||||
u16 auxADC_rssi_ctrlL_save, auxADC_rssi_ctrlH_save;
|
||||
u16 auxADC_rssi_ctrlL, auxADC_rssi_ctrlH;
|
||||
int32 auxADC_Vl;
|
||||
s32 auxADC_Vl;
|
||||
u16 RfctrlOverride5_save, RfctrlOverride6_save;
|
||||
u16 RfctrlMiscReg5_save, RfctrlMiscReg6_save;
|
||||
u16 RSSIMultCoef0QPowerDet_save;
|
||||
@ -21260,7 +21260,7 @@ void wlc_phy_rssi_cal_nphy(phy_info_t *pi)
|
||||
|
||||
static void wlc_phy_rssi_cal_nphy_rev2(phy_info_t *pi, u8 rssi_type)
|
||||
{
|
||||
int32 target_code;
|
||||
s32 target_code;
|
||||
u16 classif_state;
|
||||
u16 clip_state[2];
|
||||
u16 rssi_ctrl_state[2], pd_state[2];
|
||||
@ -21271,22 +21271,22 @@ static void wlc_phy_rssi_cal_nphy_rev2(phy_info_t *pi, u8 rssi_type)
|
||||
u8 vcm, min_vcm, vcm_tmp[4];
|
||||
u8 vcm_final[4] = { 0, 0, 0, 0 };
|
||||
u8 result_idx, ctr;
|
||||
int32 poll_results[4][4] = {
|
||||
s32 poll_results[4][4] = {
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
int32 poll_miniq[4][2] = {
|
||||
s32 poll_miniq[4][2] = {
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
{0, 0}
|
||||
};
|
||||
int32 min_d, curr_d;
|
||||
int32 fine_digital_offset[4];
|
||||
int32 poll_results_min[4] = { 0, 0, 0, 0 };
|
||||
int32 min_poll;
|
||||
s32 min_d, curr_d;
|
||||
s32 fine_digital_offset[4];
|
||||
s32 poll_results_min[4] = { 0, 0, 0, 0 };
|
||||
s32 min_poll;
|
||||
|
||||
switch (rssi_type) {
|
||||
case NPHY_RSSI_SEL_NB:
|
||||
@ -21747,11 +21747,11 @@ static void wlc_phy_rssi_cal_nphy_rev3(phy_info_t *pi)
|
||||
u16 classif_state;
|
||||
u16 clip_state[2];
|
||||
u16 clip_off[] = { 0xffff, 0xffff };
|
||||
int32 target_code;
|
||||
s32 target_code;
|
||||
u8 vcm, min_vcm;
|
||||
u8 vcm_final = 0;
|
||||
u8 result_idx;
|
||||
int32 poll_results[8][4] = {
|
||||
s32 poll_results[8][4] = {
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 0, 0},
|
||||
@ -21761,11 +21761,11 @@ static void wlc_phy_rssi_cal_nphy_rev3(phy_info_t *pi)
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
int32 poll_result_core[4] = { 0, 0, 0, 0 };
|
||||
int32 min_d = NPHY_RSSICAL_MAXD, curr_d;
|
||||
int32 fine_digital_offset[4];
|
||||
int32 poll_results_min[4] = { 0, 0, 0, 0 };
|
||||
int32 min_poll;
|
||||
s32 poll_result_core[4] = { 0, 0, 0, 0 };
|
||||
s32 min_d = NPHY_RSSICAL_MAXD, curr_d;
|
||||
s32 fine_digital_offset[4];
|
||||
s32 poll_results_min[4] = { 0, 0, 0, 0 };
|
||||
s32 min_poll;
|
||||
u8 vcm_level_max;
|
||||
u8 core;
|
||||
u8 wb_cnt;
|
||||
@ -22345,7 +22345,7 @@ wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
|
||||
u16 num_samps, t, spur;
|
||||
fixed theta = 0, rot = 0;
|
||||
u32 tbl_len;
|
||||
cint32 *tone_buf = NULL;
|
||||
cs32 *tone_buf = NULL;
|
||||
|
||||
is_phybw40 = CHSPEC_IS40(pi->radio_chanspec);
|
||||
phy_bw = (is_phybw40 == 1) ? 40 : 20;
|
||||
@ -22360,7 +22360,7 @@ wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
|
||||
tbl_len = (phy_bw << 1);
|
||||
}
|
||||
|
||||
tone_buf = (cint32 *) MALLOC(pi->sh->osh, sizeof(cint32) * tbl_len);
|
||||
tone_buf = (cs32 *) MALLOC(pi->sh->osh, sizeof(cs32) * tbl_len);
|
||||
if (tone_buf == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@ -22375,14 +22375,14 @@ wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
|
||||
|
||||
theta += rot;
|
||||
|
||||
tone_buf[t].q = (int32) FLOAT(tone_buf[t].q * max_val);
|
||||
tone_buf[t].i = (int32) FLOAT(tone_buf[t].i * max_val);
|
||||
tone_buf[t].q = (s32) FLOAT(tone_buf[t].q * max_val);
|
||||
tone_buf[t].i = (s32) FLOAT(tone_buf[t].i * max_val);
|
||||
}
|
||||
|
||||
wlc_phy_loadsampletable_nphy(pi, tone_buf, num_samps);
|
||||
|
||||
if (tone_buf != NULL)
|
||||
MFREE(pi->sh->osh, tone_buf, sizeof(cint32) * tbl_len);
|
||||
MFREE(pi->sh->osh, tone_buf, sizeof(cs32) * tbl_len);
|
||||
|
||||
return num_samps;
|
||||
}
|
||||
@ -22408,7 +22408,7 @@ wlc_phy_tx_tone_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
|
||||
}
|
||||
|
||||
static void
|
||||
wlc_phy_loadsampletable_nphy(phy_info_t *pi, cint32 *tone_buf,
|
||||
wlc_phy_loadsampletable_nphy(phy_info_t *pi, cs32 *tone_buf,
|
||||
u16 num_samps)
|
||||
{
|
||||
u16 t;
|
||||
@ -23471,21 +23471,21 @@ static void wlc_phy_txcal_phycleanup_nphy(phy_info_t *pi)
|
||||
#define NPHY_TEST_TONE_FREQ_20MHz 2500
|
||||
|
||||
void
|
||||
wlc_phy_est_tonepwr_nphy(phy_info_t *pi, int32 *qdBm_pwrbuf, u8 num_samps)
|
||||
wlc_phy_est_tonepwr_nphy(phy_info_t *pi, s32 *qdBm_pwrbuf, u8 num_samps)
|
||||
{
|
||||
u16 tssi_reg;
|
||||
int32 temp, pwrindex[2];
|
||||
int32 idle_tssi[2];
|
||||
int32 rssi_buf[4];
|
||||
int32 tssival[2];
|
||||
s32 temp, pwrindex[2];
|
||||
s32 idle_tssi[2];
|
||||
s32 rssi_buf[4];
|
||||
s32 tssival[2];
|
||||
u8 tssi_type;
|
||||
|
||||
tssi_reg = read_phy_reg(pi, 0x1e9);
|
||||
|
||||
temp = (int32) (tssi_reg & 0x3f);
|
||||
temp = (s32) (tssi_reg & 0x3f);
|
||||
idle_tssi[0] = (temp <= 31) ? temp : (temp - 64);
|
||||
|
||||
temp = (int32) ((tssi_reg >> 8) & 0x3f);
|
||||
temp = (s32) ((tssi_reg >> 8) & 0x3f);
|
||||
idle_tssi[1] = (temp <= 31) ? temp : (temp - 64);
|
||||
|
||||
tssi_type =
|
||||
@ -23494,8 +23494,8 @@ wlc_phy_est_tonepwr_nphy(phy_info_t *pi, int32 *qdBm_pwrbuf, u8 num_samps)
|
||||
|
||||
wlc_phy_poll_rssi_nphy(pi, tssi_type, rssi_buf, num_samps);
|
||||
|
||||
tssival[0] = rssi_buf[0] / ((int32) num_samps);
|
||||
tssival[1] = rssi_buf[2] / ((int32) num_samps);
|
||||
tssival[0] = rssi_buf[0] / ((s32) num_samps);
|
||||
tssival[1] = rssi_buf[2] / ((s32) num_samps);
|
||||
|
||||
pwrindex[0] = idle_tssi[0] - tssival[0] + 64;
|
||||
pwrindex[1] = idle_tssi[1] - tssival[1] + 64;
|
||||
@ -23630,14 +23630,14 @@ static void wlc_phy_precal_txgain_nphy(phy_info_t *pi)
|
||||
}
|
||||
|
||||
void
|
||||
wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, int32 dBm_targetpower, bool debug)
|
||||
wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, s32 dBm_targetpower, bool debug)
|
||||
{
|
||||
int gainctrl_loopidx;
|
||||
uint core;
|
||||
u16 m0m1, curr_m0m1;
|
||||
int32 delta_power;
|
||||
int32 txpwrindex;
|
||||
int32 qdBm_power[2];
|
||||
s32 delta_power;
|
||||
s32 txpwrindex;
|
||||
s32 qdBm_power[2];
|
||||
u16 orig_BBConfig;
|
||||
u16 phy_saveregs[4];
|
||||
u32 freq_test;
|
||||
@ -23698,7 +23698,7 @@ wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, int32 dBm_targetpower, bool debug)
|
||||
wlc_phy_table_read_nphy(pi, 15, 1, 87, 16, &m0m1);
|
||||
|
||||
for (core = 0; core < pi->pubpi.phy_corenum; core++) {
|
||||
txpwrindex = (int32) pi->nphy_cal_orig_pwr_idx[core];
|
||||
txpwrindex = (s32) pi->nphy_cal_orig_pwr_idx[core];
|
||||
|
||||
for (gainctrl_loopidx = 0; gainctrl_loopidx < 2;
|
||||
gainctrl_loopidx++) {
|
||||
@ -24568,10 +24568,10 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
|
||||
u8 curr_core;
|
||||
phy_iq_est_t est[PHY_CORE_MAX];
|
||||
nphy_iq_comp_t old_comp, new_comp;
|
||||
int32 iq = 0;
|
||||
s32 iq = 0;
|
||||
u32 ii = 0, qq = 0;
|
||||
s16 iq_nbits, qq_nbits, brsh, arsh;
|
||||
int32 a, b, temp;
|
||||
s32 a, b, temp;
|
||||
int bcmerror = BCME_OK;
|
||||
uint cal_retry = 0;
|
||||
|
||||
@ -24612,14 +24612,14 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
|
||||
arsh = 10 - (30 - iq_nbits);
|
||||
if (arsh >= 0) {
|
||||
a = (-(iq << (30 - iq_nbits)) + (ii >> (1 + arsh)));
|
||||
temp = (int32) (ii >> arsh);
|
||||
temp = (s32) (ii >> arsh);
|
||||
if (temp == 0) {
|
||||
bcmerror = BCME_ERROR;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
a = (-(iq << (30 - iq_nbits)) + (ii << (-1 - arsh)));
|
||||
temp = (int32) (ii << -arsh);
|
||||
temp = (s32) (ii << -arsh);
|
||||
if (temp == 0) {
|
||||
bcmerror = BCME_ERROR;
|
||||
break;
|
||||
@ -24631,14 +24631,14 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
|
||||
brsh = qq_nbits - 31 + 20;
|
||||
if (brsh >= 0) {
|
||||
b = (qq << (31 - qq_nbits));
|
||||
temp = (int32) (ii >> brsh);
|
||||
temp = (s32) (ii >> brsh);
|
||||
if (temp == 0) {
|
||||
bcmerror = BCME_ERROR;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
b = (qq << (31 - qq_nbits));
|
||||
temp = (int32) (ii << -brsh);
|
||||
temp = (s32) (ii << -brsh);
|
||||
if (temp == 0) {
|
||||
bcmerror = BCME_ERROR;
|
||||
break;
|
||||
@ -24646,7 +24646,7 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
|
||||
}
|
||||
b /= temp;
|
||||
b -= a * a;
|
||||
b = (int32) wlc_phy_sqrt_int((u32) b);
|
||||
b = (s32) wlc_phy_sqrt_int((u32) b);
|
||||
b -= (1 << 10);
|
||||
|
||||
if ((curr_core == PHY_CORE_0) && (core_mask & 0x1)) {
|
||||
@ -26319,7 +26319,7 @@ static void
|
||||
wlc_phy_papd_cal_setup_nphy(phy_info_t *pi, nphy_papd_restore_state *state,
|
||||
u8 core)
|
||||
{
|
||||
int32 tone_freq;
|
||||
s32 tone_freq;
|
||||
u8 off_core;
|
||||
u16 mixgain = 0;
|
||||
|
||||
@ -26743,7 +26743,7 @@ wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32 start,
|
||||
|
||||
do {
|
||||
u32 phy_a1, phy_a2;
|
||||
int32 phy_a3, phy_a4, phy_a5, phy_a6, phy_a7;
|
||||
s32 phy_a3, phy_a4, phy_a5, phy_a6, phy_a7;
|
||||
|
||||
phy_a1 = end - MIN(end, (winsz >> 1));
|
||||
phy_a2 = MIN(NPHY_PAPD_EPS_TBL_SIZE - 1, end + (winsz >> 1));
|
||||
@ -27080,7 +27080,7 @@ static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core)
|
||||
nphy_ipa_txcalgains_t phy_a4;
|
||||
bool phy_a5 = FALSE;
|
||||
bool phy_a6 = TRUE;
|
||||
int32 phy_a7, phy_a8;
|
||||
s32 phy_a7, phy_a8;
|
||||
u32 phy_a9;
|
||||
int phy_a10;
|
||||
bool phy_a11 = FALSE;
|
||||
@ -27285,7 +27285,7 @@ static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
|
||||
mod_phy_reg(pi, 0x01, (0x1 << 15), 0);
|
||||
|
||||
for (phy_b5 = 0; phy_b5 < pi->pubpi.phy_corenum; phy_b5++) {
|
||||
int32 i, val = 0;
|
||||
s32 i, val = 0;
|
||||
for (i = 0; i < 64; i++) {
|
||||
wlc_phy_table_write_nphy(pi,
|
||||
((phy_b5 ==
|
||||
@ -27534,7 +27534,7 @@ void wlc_phy_txpwr_fixpower_nphy(phy_info_t *pi)
|
||||
u32 txgain;
|
||||
u16 rad_gain, dac_gain, bbmult, m1m2;
|
||||
u8 txpi[2], chan_freq_range;
|
||||
int32 rfpwr_offset;
|
||||
s32 rfpwr_offset;
|
||||
|
||||
ASSERT(pi->nphy_txpwrctrl == PHY_TPC_HW_OFF);
|
||||
|
||||
@ -28411,8 +28411,8 @@ static void wlc_phy_ipa_internal_tssi_setup_nphy(phy_info_t *pi)
|
||||
|
||||
static void wlc_phy_txpwrctrl_idle_tssi_nphy(phy_info_t *pi)
|
||||
{
|
||||
int32 rssi_buf[4];
|
||||
int32 int_val;
|
||||
s32 rssi_buf[4];
|
||||
s32 int_val;
|
||||
|
||||
if (SCAN_RM_IN_PROGRESS(pi) || PLT_INPROG_PHY(pi) || PHY_MUTED(pi))
|
||||
|
||||
@ -28480,7 +28480,7 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(phy_info_t *pi)
|
||||
u32 idx;
|
||||
s16 a1[2], b0[2], b1[2];
|
||||
s8 target_pwr_qtrdbm[2];
|
||||
int32 num, den, pwr_est;
|
||||
s32 num, den, pwr_est;
|
||||
u8 chan_freq_range;
|
||||
u8 idle_tssi[2];
|
||||
u32 tbl_id, tbl_len, tbl_offset;
|
||||
@ -28934,7 +28934,7 @@ wlc_phy_txpwr_index_nphy(phy_info_t *pi, u8 core_mask, s8 txpwrindex,
|
||||
u32 locomp;
|
||||
u16 tmpval;
|
||||
u8 tx_pwr_ctrl_state;
|
||||
int32 rfpwr_offset;
|
||||
s32 rfpwr_offset;
|
||||
u16 regval[2];
|
||||
|
||||
if (pi->phyhang_avoid)
|
||||
|
@ -3106,7 +3106,7 @@ int wlc_set_gmode(wlc_info_t *wlc, u8 gmode, bool config)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int wlc_nmode_validate(wlc_info_t *wlc, int32 nmode)
|
||||
static int wlc_nmode_validate(wlc_info_t *wlc, s32 nmode)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -3130,7 +3130,7 @@ static int wlc_nmode_validate(wlc_info_t *wlc, int32 nmode)
|
||||
return err;
|
||||
}
|
||||
|
||||
int wlc_set_nmode(wlc_info_t *wlc, int32 nmode)
|
||||
int wlc_set_nmode(wlc_info_t *wlc, s32 nmode)
|
||||
{
|
||||
uint i;
|
||||
int err;
|
||||
@ -4489,7 +4489,7 @@ static const bcm_iovar_t *wlc_iovar_lookup(const bcm_iovar_t *table,
|
||||
/* simplified integer get interface for common WLC_GET_VAR ioctl handler */
|
||||
int wlc_iovar_getint(wlc_info_t *wlc, const char *name, int *arg)
|
||||
{
|
||||
return wlc_iovar_op(wlc, name, NULL, 0, arg, sizeof(int32), IOV_GET,
|
||||
return wlc_iovar_op(wlc, name, NULL, 0, arg, sizeof(s32), IOV_GET,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -4677,7 +4677,7 @@ wlc_iovar_check(wlc_pub_t *pub, const bcm_iovar_t *vi, void *arg, int len,
|
||||
{
|
||||
wlc_info_t *wlc = (wlc_info_t *) pub->wlc;
|
||||
int err = 0;
|
||||
int32 int_val = 0;
|
||||
s32 int_val = 0;
|
||||
|
||||
/* check generic condition flags */
|
||||
if (set) {
|
||||
@ -4746,9 +4746,9 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
|
||||
wlc_info_t *wlc = hdl;
|
||||
wlc_bsscfg_t *bsscfg;
|
||||
int err = 0;
|
||||
int32 int_val = 0;
|
||||
int32 int_val2 = 0;
|
||||
int32 *ret_int_ptr;
|
||||
s32 int_val = 0;
|
||||
s32 int_val2 = 0;
|
||||
s32 *ret_int_ptr;
|
||||
bool bool_val;
|
||||
bool bool_val2;
|
||||
wlc_bss_info_t *current_bss;
|
||||
@ -4771,7 +4771,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
|
||||
sizeof(int_val));
|
||||
|
||||
/* convenience int ptr for 4-byte gets (requires int aligned arg) */
|
||||
ret_int_ptr = (int32 *) arg;
|
||||
ret_int_ptr = (s32 *) arg;
|
||||
|
||||
bool_val = (int_val != 0) ? TRUE : FALSE;
|
||||
bool_val2 = (int_val2 != 0) ? TRUE : FALSE;
|
||||
@ -4816,7 +4816,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
|
||||
}
|
||||
|
||||
case IOV_GVAL(IOV_MPC):
|
||||
*ret_int_ptr = (int32) wlc->mpc;
|
||||
*ret_int_ptr = (s32) wlc->mpc;
|
||||
break;
|
||||
|
||||
case IOV_SVAL(IOV_MPC):
|
||||
@ -4870,8 +4870,8 @@ wlc_iovar_rangecheck(wlc_info_t *wlc, u32 val, const bcm_iovar_t *vi)
|
||||
else if (vi->flags & IOVF_WHL)
|
||||
min_val = 0;
|
||||
/* Signed values are checked against max_val and min_val */
|
||||
if ((int32) val < (int32) min_val
|
||||
|| (int32) val > (int32) max_val)
|
||||
if ((s32) val < (s32) min_val
|
||||
|| (s32) val > (s32) max_val)
|
||||
err = BCME_RANGE;
|
||||
break;
|
||||
|
||||
|
@ -637,7 +637,7 @@ struct wlc_info {
|
||||
|
||||
/* driver feature */
|
||||
bool _rifs; /* enable per-packet rifs */
|
||||
int32 rifs_advert; /* RIFS mode advertisement */
|
||||
s32 rifs_advert; /* RIFS mode advertisement */
|
||||
s8 sgi_tx; /* sgi tx */
|
||||
bool wet; /* true if wireless ethernet bridging mode */
|
||||
|
||||
@ -1004,7 +1004,7 @@ extern int wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
|
||||
extern void wlc_print_ies(wlc_info_t *wlc, u8 *ies, uint ies_len);
|
||||
#endif
|
||||
|
||||
extern int wlc_set_nmode(wlc_info_t *wlc, int32 nmode);
|
||||
extern int wlc_set_nmode(wlc_info_t *wlc, s32 nmode);
|
||||
extern void wlc_ht_mimops_cap_update(wlc_info_t *wlc, u8 mimops_mode);
|
||||
extern void wlc_mimops_action_ht_send(wlc_info_t *wlc, wlc_bsscfg_t *bsscfg,
|
||||
u8 mimops_mode);
|
||||
|
@ -345,8 +345,8 @@ typedef struct wl_rxsts {
|
||||
uint pktlength; /* pkt length minus bcm phy hdr */
|
||||
u32 mactime; /* time stamp from mac, count per 1us */
|
||||
uint sq; /* signal quality */
|
||||
int32 signal; /* in dbm */
|
||||
int32 noise; /* in dbm */
|
||||
s32 signal; /* in dbm */
|
||||
s32 noise; /* in dbm */
|
||||
uint preamble; /* Unknown, short, long */
|
||||
uint encoding; /* Unknown, CCK, PBCC, OFDM */
|
||||
uint nfrmtype; /* special 802.11n frames(AMPDU, AMSDU) */
|
||||
|
@ -43,7 +43,7 @@
|
||||
NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
|
||||
|
||||
static s8 wlc_stf_stbc_rx_get(wlc_info_t *wlc);
|
||||
static bool wlc_stf_stbc_tx_set(wlc_info_t *wlc, int32 int_val);
|
||||
static bool wlc_stf_stbc_tx_set(wlc_info_t *wlc, s32 int_val);
|
||||
static int wlc_stf_txcore_set(wlc_info_t *wlc, u8 Nsts, u8 val);
|
||||
static int wlc_stf_spatial_policy_set(wlc_info_t *wlc, int val);
|
||||
static void wlc_stf_stbc_rx_ht_update(wlc_info_t *wlc, int val);
|
||||
@ -154,7 +154,7 @@ static s8 wlc_stf_stbc_rx_get(wlc_info_t *wlc)
|
||||
return (wlc->ht_cap.cap & HT_CAP_RX_STBC_MASK) >> HT_CAP_RX_STBC_SHIFT;
|
||||
}
|
||||
|
||||
static bool wlc_stf_stbc_tx_set(wlc_info_t *wlc, int32 int_val)
|
||||
static bool wlc_stf_stbc_tx_set(wlc_info_t *wlc, s32 int_val)
|
||||
{
|
||||
if ((int_val != AUTO) && (int_val != OFF) && (int_val != ON)) {
|
||||
return FALSE;
|
||||
@ -175,7 +175,7 @@ static bool wlc_stf_stbc_tx_set(wlc_info_t *wlc, int32 int_val)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wlc_stf_stbc_rx_set(wlc_info_t *wlc, int32 int_val)
|
||||
bool wlc_stf_stbc_rx_set(wlc_info_t *wlc, s32 int_val)
|
||||
{
|
||||
if ((int_val != HT_CAP_RX_STBC_NO)
|
||||
&& (int_val != HT_CAP_RX_STBC_ONE_STREAM)) {
|
||||
@ -245,7 +245,7 @@ static int wlc_stf_spatial_policy_set(wlc_info_t *wlc, int val)
|
||||
return BCME_OK;
|
||||
}
|
||||
|
||||
int wlc_stf_txchain_set(wlc_info_t *wlc, int32 int_val, bool force)
|
||||
int wlc_stf_txchain_set(wlc_info_t *wlc, s32 int_val, bool force)
|
||||
{
|
||||
u8 txchain = (u8) int_val;
|
||||
u8 txstreams;
|
||||
@ -305,7 +305,7 @@ int wlc_stf_txchain_set(wlc_info_t *wlc, int32 int_val, bool force)
|
||||
return BCME_OK;
|
||||
}
|
||||
|
||||
int wlc_stf_rxchain_set(wlc_info_t *wlc, int32 int_val)
|
||||
int wlc_stf_rxchain_set(wlc_info_t *wlc, s32 int_val)
|
||||
{
|
||||
u8 rxchain_cnt;
|
||||
u8 rxchain = (u8) int_val;
|
||||
|
@ -29,9 +29,9 @@ extern void wlc_stf_ss_algo_channel_get(wlc_info_t *wlc,
|
||||
chanspec_t chanspec);
|
||||
extern int wlc_stf_ss_update(wlc_info_t *wlc, struct wlcband *band);
|
||||
extern void wlc_stf_phy_txant_upd(wlc_info_t *wlc);
|
||||
extern int wlc_stf_txchain_set(wlc_info_t *wlc, int32 int_val, bool force);
|
||||
extern int wlc_stf_rxchain_set(wlc_info_t *wlc, int32 int_val);
|
||||
extern bool wlc_stf_stbc_rx_set(wlc_info_t *wlc, int32 int_val);
|
||||
extern int wlc_stf_txchain_set(wlc_info_t *wlc, s32 int_val, bool force);
|
||||
extern int wlc_stf_rxchain_set(wlc_info_t *wlc, s32 int_val);
|
||||
extern bool wlc_stf_stbc_rx_set(wlc_info_t *wlc, s32 int_val);
|
||||
|
||||
extern int wlc_stf_ant_txant_validate(wlc_info_t *wlc, s8 val);
|
||||
extern void wlc_stf_phy_txant_upd(wlc_info_t *wlc);
|
||||
|
@ -391,7 +391,7 @@ BCMATTACHFN(srom_parsecis) (osl_t *osh, u8 *pcis[], uint ciscnt,
|
||||
u32 w32;
|
||||
uint funcid;
|
||||
uint cisnum;
|
||||
int32 boardnum;
|
||||
s32 boardnum;
|
||||
int err;
|
||||
bool standard_cis;
|
||||
|
||||
|
@ -364,7 +364,7 @@ int bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set)
|
||||
case IOVT_UINT8:
|
||||
case IOVT_UINT16:
|
||||
case IOVT_UINT32:
|
||||
/* all integers are int32 sized args at the ioctl interface */
|
||||
/* all integers are s32 sized args at the ioctl interface */
|
||||
if (len < (int)sizeof(int)) {
|
||||
bcmerror = BCME_BUFTOOSHORT;
|
||||
}
|
||||
|
@ -22,12 +22,12 @@ If input number is greater than 0x7fff then output is saturated to 0x7fff.
|
||||
else if input number is less than 0xffff8000 then output is saturated to 0xffff8000
|
||||
else output is same as input.
|
||||
*/
|
||||
s16 qm_sat32(int32 op)
|
||||
s16 qm_sat32(s32 op)
|
||||
{
|
||||
s16 result;
|
||||
if (op > (int32) 0x7fff) {
|
||||
if (op > (s32) 0x7fff) {
|
||||
result = 0x7fff;
|
||||
} else if (op < (int32) 0xffff8000) {
|
||||
} else if (op < (s32) 0xffff8000) {
|
||||
result = (s16) (0x8000);
|
||||
} else {
|
||||
result = (s16) op;
|
||||
@ -41,9 +41,9 @@ This multiplication is similar to compiler multiplication. This operation is def
|
||||
16 bit multiplication on the processor platform is cheaper than 32 bit multiplication (as
|
||||
the most of qmath functions can be replaced with processor intrinsic instructions).
|
||||
*/
|
||||
int32 qm_mul321616(s16 op1, s16 op2)
|
||||
s32 qm_mul321616(s16 op1, s16 op2)
|
||||
{
|
||||
return (int32) (op1) * (int32) (op2);
|
||||
return (s32) (op1) * (s32) (op2);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -53,8 +53,8 @@ shifted by 16 bits.
|
||||
*/
|
||||
s16 qm_mul16(s16 op1, s16 op2)
|
||||
{
|
||||
int32 result;
|
||||
result = ((int32) (op1) * (int32) (op2));
|
||||
s32 result;
|
||||
result = ((s32) (op1) * (s32) (op2));
|
||||
return (s16) (result >> 16);
|
||||
}
|
||||
|
||||
@ -65,13 +65,13 @@ This function remove the extra sign bit created by the multiplication by leftshi
|
||||
twice that of compiler multiplication. (i.e. qm_muls321616(2,3)=12).
|
||||
When both input 16 bit numbers are 0x8000, then the result is saturated to 0x7fffffff.
|
||||
*/
|
||||
int32 qm_muls321616(s16 op1, s16 op2)
|
||||
s32 qm_muls321616(s16 op1, s16 op2)
|
||||
{
|
||||
int32 result;
|
||||
s32 result;
|
||||
if (op1 == (s16) (0x8000) && op2 == (s16) (0x8000)) {
|
||||
result = 0x7fffffff;
|
||||
} else {
|
||||
result = ((int32) (op1) * (int32) (op2));
|
||||
result = ((s32) (op1) * (s32) (op2));
|
||||
result = result << 1;
|
||||
}
|
||||
return result;
|
||||
@ -95,11 +95,11 @@ When both the 16bit inputs are 0x8000 then the output is saturated to 0x7fffffff
|
||||
*/
|
||||
s16 qm_muls16(s16 op1, s16 op2)
|
||||
{
|
||||
int32 result;
|
||||
s32 result;
|
||||
if (op1 == (s16) 0x8000 && op2 == (s16) 0x8000) {
|
||||
result = 0x7fffffff;
|
||||
} else {
|
||||
result = ((int32) (op1) * (int32) (op2));
|
||||
result = ((s32) (op1) * (s32) (op2));
|
||||
}
|
||||
return (s16) (result >> 15);
|
||||
}
|
||||
@ -108,9 +108,9 @@ s16 qm_muls16(s16 op1, s16 op2)
|
||||
Description: This function add two 32 bit numbers and return the 32bit result.
|
||||
If the result overflow 32 bits, the output will be saturated to 32bits.
|
||||
*/
|
||||
int32 qm_add32(int32 op1, int32 op2)
|
||||
s32 qm_add32(s32 op1, s32 op2)
|
||||
{
|
||||
int32 result;
|
||||
s32 result;
|
||||
result = op1 + op2;
|
||||
if (op1 < 0 && op2 < 0 && result > 0) {
|
||||
result = 0x80000000;
|
||||
@ -127,10 +127,10 @@ If the result overflow 16 bits, the output will be saturated to 16bits.
|
||||
s16 qm_add16(s16 op1, s16 op2)
|
||||
{
|
||||
s16 result;
|
||||
int32 temp = (int32) op1 + (int32) op2;
|
||||
if (temp > (int32) 0x7fff) {
|
||||
s32 temp = (s32) op1 + (s32) op2;
|
||||
if (temp > (s32) 0x7fff) {
|
||||
result = (s16) 0x7fff;
|
||||
} else if (temp < (int32) 0xffff8000) {
|
||||
} else if (temp < (s32) 0xffff8000) {
|
||||
result = (s16) 0xffff8000;
|
||||
} else {
|
||||
result = (s16) temp;
|
||||
@ -145,10 +145,10 @@ If the result overflow 16 bits, the output will be saturated to 16bits.
|
||||
s16 qm_sub16(s16 op1, s16 op2)
|
||||
{
|
||||
s16 result;
|
||||
int32 temp = (int32) op1 - (int32) op2;
|
||||
if (temp > (int32) 0x7fff) {
|
||||
s32 temp = (s32) op1 - (s32) op2;
|
||||
if (temp > (s32) 0x7fff) {
|
||||
result = (s16) 0x7fff;
|
||||
} else if (temp < (int32) 0xffff8000) {
|
||||
} else if (temp < (s32) 0xffff8000) {
|
||||
result = (s16) 0xffff8000;
|
||||
} else {
|
||||
result = (s16) temp;
|
||||
@ -160,9 +160,9 @@ s16 qm_sub16(s16 op1, s16 op2)
|
||||
Description: This function make 32 bit subtraction and return the 32bit result.
|
||||
If the result overflow 32 bits, the output will be saturated to 32bits.
|
||||
*/
|
||||
int32 qm_sub32(int32 op1, int32 op2)
|
||||
s32 qm_sub32(s32 op1, s32 op2)
|
||||
{
|
||||
int32 result;
|
||||
s32 result;
|
||||
result = op1 - op2;
|
||||
if (op1 >= 0 && op2 < 0 && result < 0) {
|
||||
result = 0x7fffffff;
|
||||
@ -177,9 +177,9 @@ Description: This function multiply input 16 bit numbers and accumulate the resu
|
||||
into the input 32 bit number and return the 32 bit accumulated result.
|
||||
If the accumulation result in overflow, then the output will be saturated.
|
||||
*/
|
||||
int32 qm_mac321616(int32 acc, s16 op1, s16 op2)
|
||||
s32 qm_mac321616(s32 acc, s16 op1, s16 op2)
|
||||
{
|
||||
int32 result;
|
||||
s32 result;
|
||||
result = qm_add32(acc, qm_mul321616(op1, op2));
|
||||
return result;
|
||||
}
|
||||
@ -189,10 +189,10 @@ Description: This function make a 32 bit saturated left shift when the specified
|
||||
is +ve. This function will make a 32 bit right shift when the specified shift is -ve.
|
||||
This function return the result after shifting operation.
|
||||
*/
|
||||
int32 qm_shl32(int32 op, int shift)
|
||||
s32 qm_shl32(s32 op, int shift)
|
||||
{
|
||||
int i;
|
||||
int32 result;
|
||||
s32 result;
|
||||
result = op;
|
||||
if (shift > 31)
|
||||
shift = 31;
|
||||
@ -213,7 +213,7 @@ Description: This function make a 32 bit right shift when shift is +ve.
|
||||
This function make a 32 bit saturated left shift when shift is -ve. This function
|
||||
return the result of the shift operation.
|
||||
*/
|
||||
int32 qm_shr32(int32 op, int shift)
|
||||
s32 qm_shr32(s32 op, int shift)
|
||||
{
|
||||
return qm_shl32(op, -shift);
|
||||
}
|
||||
@ -275,7 +275,7 @@ s16 qm_norm16(s16 op)
|
||||
Description: This function return the number of redundant sign bits in a 32 bit number.
|
||||
Example: qm_norm32(0x00000080) = 23
|
||||
*/
|
||||
s16 qm_norm32(int32 op)
|
||||
s16 qm_norm32(s32 op)
|
||||
{
|
||||
u16 u16extraSignBits;
|
||||
if (op == 0) {
|
||||
@ -299,8 +299,8 @@ s16 qm_div_s(s16 num, s16 denom)
|
||||
{
|
||||
s16 var_out;
|
||||
s16 iteration;
|
||||
int32 L_num;
|
||||
int32 L_denom;
|
||||
s32 L_num;
|
||||
s32 L_denom;
|
||||
L_num = (num) << 15;
|
||||
L_denom = (denom) << 15;
|
||||
for (iteration = 0; iteration < 15; iteration++) {
|
||||
@ -359,10 +359,10 @@ s16 qm_div16(s16 num, s16 denom, s16 *qQuotient)
|
||||
/*
|
||||
Description: This function compute absolute value of a 32 bit number.
|
||||
*/
|
||||
int32 qm_abs32(int32 op)
|
||||
s32 qm_abs32(s32 op)
|
||||
{
|
||||
if (op < 0) {
|
||||
if (op == (int32) 0x80000000) {
|
||||
if (op == (s32) 0x80000000) {
|
||||
return 0x7fffffff;
|
||||
} else {
|
||||
return -op;
|
||||
@ -380,9 +380,9 @@ The qformat of the quotient is returned through the pointer (qquotient) passed
|
||||
to this function. The qformat of quotient is adjusted appropriately such that
|
||||
the quotient occupies all 16 bits.
|
||||
*/
|
||||
s16 qm_div163232(int32 num, int32 denom, s16 *qquotient)
|
||||
s16 qm_div163232(s32 num, s32 denom, s16 *qquotient)
|
||||
{
|
||||
int32 sign;
|
||||
s32 sign;
|
||||
s16 nNum, nDenom;
|
||||
sign = num ^ denom;
|
||||
num = qm_abs32(num);
|
||||
@ -404,11 +404,11 @@ Description: This function multiply a 32 bit number with a 16 bit number.
|
||||
The multiplicaton result is right shifted by 16 bits to fit the result
|
||||
into 32 bit output.
|
||||
*/
|
||||
int32 qm_mul323216(int32 op1, s16 op2)
|
||||
s32 qm_mul323216(s32 op1, s16 op2)
|
||||
{
|
||||
s16 hi;
|
||||
u16 lo;
|
||||
int32 result;
|
||||
s32 result;
|
||||
hi = op1 >> 16;
|
||||
lo = (s16) (op1 & 0xffff);
|
||||
result = qm_mul321616(hi, op2);
|
||||
@ -420,9 +420,9 @@ int32 qm_mul323216(int32 op1, s16 op2)
|
||||
Description: This function multiply signed 16 bit number with unsigned 16 bit number and return
|
||||
the result in 32 bits.
|
||||
*/
|
||||
int32 qm_mulsu321616(s16 op1, u16 op2)
|
||||
s32 qm_mulsu321616(s16 op1, u16 op2)
|
||||
{
|
||||
return (int32) (op1) * op2;
|
||||
return (s32) (op1) * op2;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -431,11 +431,11 @@ right shifted by 15 bits to fit the result into 32 bits. Right shifting by only
|
||||
16 bits is done to remove the extra sign bit formed by multiplication from the return value.
|
||||
When the input numbers are 0x80000000, 0x8000 the return value is saturated to 0x7fffffff.
|
||||
*/
|
||||
int32 qm_muls323216(int32 op1, s16 op2)
|
||||
s32 qm_muls323216(s32 op1, s16 op2)
|
||||
{
|
||||
s16 hi;
|
||||
u16 lo;
|
||||
int32 result;
|
||||
s32 result;
|
||||
hi = op1 >> 16;
|
||||
lo = (s16) (op1 & 0xffff);
|
||||
result = qm_muls321616(hi, op2);
|
||||
@ -448,11 +448,11 @@ Description: This function multiply two 32 bit numbers. The multiplication resul
|
||||
shifted by 32 bits to fit the multiplication result into 32 bits. The right shifted
|
||||
multiplication result is returned as output.
|
||||
*/
|
||||
int32 qm_mul32(int32 a, int32 b)
|
||||
s32 qm_mul32(s32 a, s32 b)
|
||||
{
|
||||
s16 hi1, hi2;
|
||||
u16 lo1, lo2;
|
||||
int32 result;
|
||||
s32 result;
|
||||
hi1 = a >> 16;
|
||||
hi2 = b >> 16;
|
||||
lo1 = (u16) (a & 0xffff);
|
||||
@ -471,11 +471,11 @@ instead of 32 bits is done to remove the extra sign bit formed by multiplication
|
||||
When the input numbers are 0x80000000, 0x80000000 the return value is saturated to
|
||||
0x7fffffff.
|
||||
*/
|
||||
int32 qm_muls32(int32 a, int32 b)
|
||||
s32 qm_muls32(s32 a, s32 b)
|
||||
{
|
||||
s16 hi1, hi2;
|
||||
u16 lo1, lo2;
|
||||
int32 result;
|
||||
s32 result;
|
||||
hi1 = a >> 16;
|
||||
hi2 = b >> 16;
|
||||
lo1 = (u16) (a & 0xffff);
|
||||
@ -545,11 +545,11 @@ qLog10N - address where log10N qformat will be written.
|
||||
Note/Problem:
|
||||
For accurate results input should be in normalized or near normalized form.
|
||||
*/
|
||||
void qm_log10(int32 N, s16 qN, s16 *log10N, s16 *qLog10N)
|
||||
void qm_log10(s32 N, s16 qN, s16 *log10N, s16 *qLog10N)
|
||||
{
|
||||
s16 s16norm, s16tableIndex, s16errorApproximation;
|
||||
u16 u16offset;
|
||||
int32 s32log;
|
||||
s32 s32log;
|
||||
|
||||
/* Logerithm of negative values is undefined.
|
||||
* assert N is greater than 0.
|
||||
@ -593,7 +593,7 @@ void qm_log10(int32 N, s16 qN, s16 *log10N, s16 *qLog10N)
|
||||
/* adjust for the qformat of the N as
|
||||
* log2(mag * 2^x) = log2(mag) + x
|
||||
*/
|
||||
s32log = qm_add32(s32log, ((int32) -qN) << 15); /* q.15 format */
|
||||
s32log = qm_add32(s32log, ((s32) -qN) << 15); /* q.15 format */
|
||||
|
||||
/* normalize the result. */
|
||||
s16norm = qm_norm32(s32log);
|
||||
@ -631,10 +631,10 @@ sqrtN - address where 1/N has to be written.
|
||||
qsqrtN - address where q format of 1/N has to be written.
|
||||
*/
|
||||
#define qx 29
|
||||
void qm_1byN(int32 N, s16 qN, int32 *result, s16 *qResult)
|
||||
void qm_1byN(s32 N, s16 qN, s32 *result, s16 *qResult)
|
||||
{
|
||||
s16 normN;
|
||||
int32 s32firstTerm, s32secondTerm, x;
|
||||
s32 s32firstTerm, s32secondTerm, x;
|
||||
int i;
|
||||
|
||||
normN = qm_norm32(N);
|
||||
@ -646,10 +646,10 @@ void qm_1byN(int32 N, s16 qN, int32 *result, s16 *qResult)
|
||||
|
||||
/* Take the initial guess as 1/0.75 in qx format with appropriate sign. */
|
||||
if (N >= 0) {
|
||||
x = (int32) ((1 / 0.75) * (1 << qx));
|
||||
x = (s32) ((1 / 0.75) * (1 << qx));
|
||||
/* input no is in the range 0.5 to 1. So 1/0.75 is taken as initial guess. */
|
||||
} else {
|
||||
x = (int32) ((1 / -0.75) * (1 << qx));
|
||||
x = (s32) ((1 / -0.75) * (1 << qx));
|
||||
/* input no is in the range -0.5 to -1. So 1/-0.75 is taken as initial guess. */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user