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>
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;
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)
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;
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;
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;
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;
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;
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;
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;
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;
int val_size)
{
int bcmerror = 0;
- int32 int_val = 0;
+ s32 int_val = 0;
DHD_TRACE(("%s: Enter\n", __func__));
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;
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;
#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;
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;
}
u32 toe_ol;
#endif
int ifidx = dhd_net2idx(dhd, net);
- int32 ret = 0;
+ s32 ret = 0;
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
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 */
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;
}
static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
{
int err;
- int32 iovalue;
+ s32 iovalue;
DHD_TRACE(("%s: Enter\n", __func__));
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 "
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;
switch (actionid) {
case IOV_GVAL(IOV_INTR):
- int_val = (int32) bus->intr;
+ int_val = (s32) bus->intr;
bcopy(&int_val, arg, val_size);
break;
break;
case IOV_GVAL(IOV_POLLRATE):
- int_val = (int32) bus->pollrate;
+ int_val = (s32) bus->pollrate;
bcopy(&int_val, arg, val_size);
break;
break;
case IOV_GVAL(IOV_IDLECLOCK):
- int_val = (int32) bus->idleclock;
+ int_val = (s32) bus->idleclock;
bcopy(&int_val, arg, val_size);
break;
break;
case IOV_GVAL(IOV_SD1IDLE):
- int_val = (int32) sd1idle;
+ int_val = (s32) sd1idle;
bcopy(&int_val, arg, val_size);
break;
}
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;
break;
case IOV_GVAL(IOV_READAHEAD):
- int_val = (int32) dhd_readahead;
+ int_val = (s32) dhd_readahead;
bcopy(&int_val, arg, val_size);
break;
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;
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;
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;
}
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;
}
}
case IOV_GVAL(IOV_FORCEEVEN):
- int_val = (int32) forcealign;
+ int_val = (s32) forcealign;
bcopy(&int_val, arg, val_size);
break;
break;
case IOV_GVAL(IOV_TXBOUND):
- int_val = (int32) dhd_txbound;
+ int_val = (s32) dhd_txbound;
bcopy(&int_val, arg, val_size);
break;
break;
case IOV_GVAL(IOV_RXBOUND):
- int_val = (int32) dhd_rxbound;
+ int_val = (s32) dhd_rxbound;
bcopy(&int_val, arg, val_size);
break;
break;
case IOV_GVAL(IOV_TXMINMAX):
- int_val = (int32) dhd_txminmax;
+ int_val = (s32) dhd_txminmax;
bcopy(&int_val, arg, val_size);
break;
#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;
/* 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__,
/* 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__,
}
/* 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__,
static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh)
{
- int32 fnum;
+ s32 fnum;
DHD_TRACE(("%s: Enter\n", __func__));
/* ...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;
/* 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 {
/* 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 {
/* 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 {
/*
** cfg80211_ops api/callback list
*/
-static int32 wl_cfg80211_change_iface(struct wiphy *wiphy,
+static s32 wl_cfg80211_change_iface(struct wiphy *wiphy,
struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params);
-static int32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+static s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid);
-static int32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request);
-static int32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
-static int32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
+static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params);
-static int32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
+static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev);
-static int32 wl_cfg80211_get_station(struct wiphy *wiphy,
+static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
struct net_device *dev, u8 *mac,
struct station_info *sinfo);
-static int32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
+static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
struct net_device *dev, bool enabled,
- int32 timeout);
-static int32 wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
+ s32 timeout);
+static s32 wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
struct net_device *dev,
const u8 *addr,
const struct cfg80211_bitrate_mask
*mask);
static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme);
-static int32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code);
-static int32 wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type,
- int32 dbm);
-static int32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, int32 *dbm);
-static int32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
+ s32 dbm);
+static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
+static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx);
-static int32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
struct key_params *params);
-static int32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr);
-static int32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
void *cookie, void (*callback) (void *cookie,
struct
key_params *
params));
-static int32 wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
+static s32 wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx);
-static int32 wl_cfg80211_resume(struct wiphy *wiphy);
-static int32 wl_cfg80211_suspend(struct wiphy *wiphy);
-static int32 wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_resume(struct wiphy *wiphy);
+static s32 wl_cfg80211_suspend(struct wiphy *wiphy);
+static s32 wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa);
-static int32 wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa);
-static int32 wl_cfg80211_flush_pmksa(struct wiphy *wiphy,
+static s32 wl_cfg80211_flush_pmksa(struct wiphy *wiphy,
struct net_device *dev);
/*
** event & event Q handlers for cfg80211 interfaces
*/
-static int32 wl_create_event_handler(struct wl_priv *wl);
+static s32 wl_create_event_handler(struct wl_priv *wl);
static void wl_destroy_event_handler(struct wl_priv *wl);
-static int32 wl_event_handler(void *data);
+static s32 wl_event_handler(void *data);
static void wl_init_eq(struct wl_priv *wl);
static void wl_flush_eq(struct wl_priv *wl);
static void wl_lock_eq(struct wl_priv *wl);
static void wl_init_eq_lock(struct wl_priv *wl);
static void wl_init_eloop_handler(struct wl_event_loop *el);
static struct wl_event_q *wl_deq_event(struct wl_priv *wl);
-static int32 wl_enq_event(struct wl_priv *wl, u32 type,
+static s32 wl_enq_event(struct wl_priv *wl, u32 type,
const wl_event_msg_t *msg, void *data);
static void wl_put_event(struct wl_event_q *e);
static void wl_wakeup_event(struct wl_priv *wl);
-static int32 wl_notify_connect_status(struct wl_priv *wl,
+static s32 wl_notify_connect_status(struct wl_priv *wl,
struct net_device *ndev,
const wl_event_msg_t *e, void *data);
-static int32 wl_notify_roaming_status(struct wl_priv *wl,
+static s32 wl_notify_roaming_status(struct wl_priv *wl,
struct net_device *ndev,
const wl_event_msg_t *e, void *data);
-static int32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
-static int32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data,
bool completed);
-static int32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
-static int32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
/*
/*
** ioctl utilites
*/
-static int32 wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
- int32 buf_len);
-static __used int32 wl_dev_bufvar_set(struct net_device *dev, s8 *name,
- s8 *buf, int32 len);
-static int32 wl_dev_intvar_set(struct net_device *dev, s8 *name, int32 val);
-static int32 wl_dev_intvar_get(struct net_device *dev, s8 *name,
- int32 *retval);
-static int32 wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg,
+static s32 wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
+ s32 buf_len);
+static __used s32 wl_dev_bufvar_set(struct net_device *dev, s8 *name,
+ s8 *buf, s32 len);
+static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val);
+static s32 wl_dev_intvar_get(struct net_device *dev, s8 *name,
+ s32 *retval);
+static s32 wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg,
u32 len);
/*
** cfg80211 set_wiphy_params utilities
*/
-static int32 wl_set_frag(struct net_device *dev, u32 frag_threshold);
-static int32 wl_set_rts(struct net_device *dev, u32 frag_threshold);
-static int32 wl_set_retry(struct net_device *dev, u32 retry, bool l);
+static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold);
+static s32 wl_set_rts(struct net_device *dev, u32 frag_threshold);
+static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l);
/*
** wl profile utilities
*/
-static int32 wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e,
- void *data, int32 item);
-static void *wl_read_prof(struct wl_priv *wl, int32 item);
+static s32 wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e,
+ void *data, s32 item);
+static void *wl_read_prof(struct wl_priv *wl, s32 item);
static void wl_init_prof(struct wl_profile *prof);
/*
** cfg80211 connect utilites
*/
-static int32 wl_set_wpa_version(struct net_device *dev,
+static s32 wl_set_wpa_version(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static int32 wl_set_auth_type(struct net_device *dev,
+static s32 wl_set_auth_type(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static int32 wl_set_set_cipher(struct net_device *dev,
+static s32 wl_set_set_cipher(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static int32 wl_set_key_mgmt(struct net_device *dev,
+static s32 wl_set_key_mgmt(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static int32 wl_set_set_sharedkey(struct net_device *dev,
+static s32 wl_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static int32 wl_get_assoc_ies(struct wl_priv *wl);
+static s32 wl_get_assoc_ies(struct wl_priv *wl);
/*
** information element utilities
*/
static void wl_rst_ie(struct wl_priv *wl);
-static int32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
-static int32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size);
-static int32 wl_cp_ie(struct wl_priv *wl, u8 *dst, u16 dst_size);
+static s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
+static s32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size);
+static s32 wl_cp_ie(struct wl_priv *wl, u8 *dst, u16 dst_size);
static u32 wl_get_ielen(struct wl_priv *wl);
-static int32 wl_mode_to_nl80211_iftype(int32 mode);
+static s32 wl_mode_to_nl80211_iftype(s32 mode);
-static struct wireless_dev *wl_alloc_wdev(int32 sizeof_iface,
+static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
struct device *dev);
static void wl_free_wdev(struct wl_priv *wl);
-static int32 wl_inform_bss(struct wl_priv *wl);
-static int32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi);
-static int32 wl_update_bss_info(struct wl_priv *wl);
+static s32 wl_inform_bss(struct wl_priv *wl);
+static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi);
+static s32 wl_update_bss_info(struct wl_priv *wl);
-static int32 wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
+static s32 wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
struct key_params *params);
/*
** wl_priv memory init/deinit utilities
*/
-static int32 wl_init_priv_mem(struct wl_priv *wl);
+static s32 wl_init_priv_mem(struct wl_priv *wl);
static void wl_deinit_priv_mem(struct wl_priv *wl);
static void wl_delay(u32 ms);
static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e);
static void wl_link_up(struct wl_priv *wl);
static void wl_link_down(struct wl_priv *wl);
-static int32 wl_dongle_mode(struct net_device *ndev, int32 iftype);
-static int32 __wl_cfg80211_up(struct wl_priv *wl);
-static int32 __wl_cfg80211_down(struct wl_priv *wl);
-static int32 wl_dongle_probecap(struct wl_priv *wl);
+static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype);
+static s32 __wl_cfg80211_up(struct wl_priv *wl);
+static s32 __wl_cfg80211_down(struct wl_priv *wl);
+static s32 wl_dongle_probecap(struct wl_priv *wl);
static void wl_init_conf(struct wl_conf *conf);
/*
** dongle configuration utilities
*/
#ifndef EMBEDDED_PLATFORM
-static int32 wl_dongle_mode(struct net_device *ndev, int32 iftype);
-static int32 wl_dongle_country(struct net_device *ndev, u8 ccode);
-static int32 wl_dongle_up(struct net_device *ndev, u32 up);
-static int32 wl_dongle_power(struct net_device *ndev, u32 power_mode);
-static int32 wl_dongle_glom(struct net_device *ndev, u32 glom,
+static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype);
+static s32 wl_dongle_country(struct net_device *ndev, u8 ccode);
+static s32 wl_dongle_up(struct net_device *ndev, u32 up);
+static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode);
+static s32 wl_dongle_glom(struct net_device *ndev, u32 glom,
u32 dongle_align);
-static int32 wl_dongle_roam(struct net_device *ndev, u32 roamvar,
+static s32 wl_dongle_roam(struct net_device *ndev, u32 roamvar,
u32 bcn_timeout);
-static int32 wl_dongle_eventmsg(struct net_device *ndev);
-static int32 wl_dongle_scantime(struct net_device *ndev, int32 scan_assoc_time,
- int32 scan_unassoc_time);
-static int32 wl_dongle_offload(struct net_device *ndev, int32 arpoe,
- int32 arp_ol);
-static int32 wl_pattern_atoh(s8 *src, s8 *dst);
-static int32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode);
-static int32 wl_update_wiphybands(struct wl_priv *wl);
+static s32 wl_dongle_eventmsg(struct net_device *ndev);
+static s32 wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
+ s32 scan_unassoc_time);
+static s32 wl_dongle_offload(struct net_device *ndev, s32 arpoe,
+ s32 arp_ol);
+static s32 wl_pattern_atoh(s8 *src, s8 *dst);
+static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode);
+static s32 wl_update_wiphybands(struct wl_priv *wl);
#endif /* !EMBEDDED_PLATFORM */
-static int32 wl_config_dongle(struct wl_priv *wl, bool need_lock);
+static s32 wl_config_dongle(struct wl_priv *wl, bool need_lock);
/*
** iscan handler
*/
static void wl_iscan_timer(unsigned long data);
static void wl_term_iscan(struct wl_priv *wl);
-static int32 wl_init_iscan(struct wl_priv *wl);
-static int32 wl_iscan_thread(void *data);
-static int32 wl_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
- void *param, int32 paramlen, void *bufptr,
- int32 buflen);
-static int32 wl_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
- void *param, int32 paramlen, void *bufptr,
- int32 buflen);
-static int32 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid,
+static s32 wl_init_iscan(struct wl_priv *wl);
+static s32 wl_iscan_thread(void *data);
+static s32 wl_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
+ void *param, s32 paramlen, void *bufptr,
+ s32 buflen);
+static s32 wl_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
+ void *param, s32 paramlen, void *bufptr,
+ s32 buflen);
+static s32 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid,
u16 action);
-static int32 wl_do_iscan(struct wl_priv *wl);
-static int32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan);
-static int32 wl_invoke_iscan(struct wl_priv *wl);
-static int32 wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+static s32 wl_do_iscan(struct wl_priv *wl);
+static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan);
+static s32 wl_invoke_iscan(struct wl_priv *wl);
+static s32 wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
struct wl_scan_results **bss_list);
static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
static void wl_init_iscan_eloop(struct wl_iscan_eloop *el);
-static int32 wl_iscan_done(struct wl_priv *wl);
-static int32 wl_iscan_pending(struct wl_priv *wl);
-static int32 wl_iscan_inprogress(struct wl_priv *wl);
-static int32 wl_iscan_aborted(struct wl_priv *wl);
+static s32 wl_iscan_done(struct wl_priv *wl);
+static s32 wl_iscan_pending(struct wl_priv *wl);
+static s32 wl_iscan_inprogress(struct wl_priv *wl);
+static s32 wl_iscan_aborted(struct wl_priv *wl);
/*
** fw/nvram downloading handler
/*
* update pmklist to dongle
*/
-static __used int32 wl_update_pmklist(struct net_device *dev,
- struct wl_pmk_list *pmk_list, int32 err);
+static __used s32 wl_update_pmklist(struct net_device *dev,
+ struct wl_pmk_list *pmk_list, s32 err);
#define WL_PRIV_GET() \
({ \
key->iv_initialized = dtoh32(key->iv_initialized);
}
-static int32
+static s32
wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
{
struct ifreq ifr;
struct wl_ioctl ioc;
mm_segment_t fs;
- int32 err = 0;
+ s32 err = 0;
memset(&ioc, 0, sizeof(ioc));
ioc.cmd = cmd;
return err;
}
-static int32
+static s32
wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct wireless_dev *wdev;
- int32 infra = 0;
- int32 ap = 0;
- int32 err = 0;
+ s32 infra = 0;
+ s32 ap = 0;
+ s32 err = 0;
CHECK_SYS_UP();
switch (type) {
}
-static int32
+static s32
wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
- int32 paramlen, void *bufptr, int32 buflen)
+ s32 paramlen, void *bufptr, s32 buflen)
{
- int32 iolen;
+ s32 iolen;
iolen = bcm_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(unlikely(!iolen));
return wl_dev_ioctl(dev, WLC_SET_VAR, bufptr, iolen);
}
-static int32
+static s32
wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
- int32 paramlen, void *bufptr, int32 buflen)
+ s32 paramlen, void *bufptr, s32 buflen)
{
- int32 iolen;
+ s32 iolen;
iolen = bcm_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(unlikely(!iolen));
return wl_dev_ioctl(dev, WLC_GET_VAR, bufptr, buflen);
}
-static int32
+static s32
wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
{
- int32 params_size =
+ s32 params_size =
(WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params));
struct wl_iscan_params *params;
- int32 err = 0;
+ s32 err = 0;
if (ssid && ssid->SSID_len)
params_size += sizeof(struct wlc_ssid);
return err;
}
-static int32 wl_do_iscan(struct wl_priv *wl)
+static s32 wl_do_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
struct wlc_ssid ssid;
- int32 err = 0;
+ s32 err = 0;
/* Broadcast scan by default */
memset(&ssid, 0, sizeof(ssid));
iscan->state = WL_ISCAN_STATE_SCANING;
if (wl->active_scan) {
- int32 passive_scan = 0;
+ s32 passive_scan = 0;
/* make it active scan */
err = wl_dev_ioctl(wl_to_ndev(wl), WLC_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
return err;
}
-static int32
+static s32
__wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid)
struct wl_scan_req *sr = wl_to_sr(wl);
bool iscan_req;
bool spec_scan;
- int32 err = 0;
+ s32 err = 0;
if (unlikely(test_bit(WL_STATUS_SCANNING, &wl->status))) {
WL_ERR(("Scanning already : status (%d)\n", (int)wl->status));
}
WL_DBG(("sr->ssid.SSID_len (%d)\n", sr->ssid.SSID_len));
if (wl->active_scan) {
- int32 pssive_scan = 0;
+ s32 pssive_scan = 0;
/* make it active scan */
err = wl_dev_ioctl(ndev, WLC_SET_PASSIVE_SCAN,
&pssive_scan, sizeof(pssive_scan));
return err;
}
-static int32
+static s32
wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request)
{
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
return err;
}
-static int32 wl_dev_intvar_set(struct net_device *dev, s8 *name, int32 val)
+static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
{
s8 buf[WLC_IOCTL_SMLEN];
u32 len;
- int32 err = 0;
+ s32 err = 0;
val = htod32(val);
len = bcm_mkiovar(name, (char *)(&val), sizeof(val), buf, sizeof(buf));
return err;
}
-static int32
-wl_dev_intvar_get(struct net_device *dev, s8 *name, int32 *retval)
+static s32
+wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
{
union {
s8 buf[WLC_IOCTL_SMLEN];
- int32 val;
+ s32 val;
} var;
u32 len;
u32 data_null;
- int32 err = 0;
+ s32 err = 0;
len =
bcm_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
return err;
}
-static int32 wl_set_rts(struct net_device *dev, u32 rts_threshold)
+static s32 wl_set_rts(struct net_device *dev, u32 rts_threshold)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_intvar_set(dev, "rtsthresh", rts_threshold);
if (unlikely(err)) {
return err;
}
-static int32 wl_set_frag(struct net_device *dev, u32 frag_threshold)
+static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_intvar_set(dev, "fragthresh", frag_threshold);
if (unlikely(err)) {
return err;
}
-static int32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
+static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
{
- int32 err = 0;
+ s32 err = 0;
u32 cmd = (l ? WLC_SET_LRL : WLC_SET_SRL);
retry = htod32(retry);
return err;
}
-static int32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
if (changed & WIPHY_PARAM_RTS_THRESHOLD &&
return err;
}
-static int32
+static s32
wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
struct ieee80211_channel *chan;
struct wl_join_params join_params;
struct cfg80211_ssid ssid;
- int32 scan_retry = 0;
- int32 err = 0;
+ s32 scan_retry = 0;
+ s32 err = 0;
CHECK_SYS_UP();
if (params->bssid) {
return err;
}
-static int32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
+static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
wl_link_down(wl);
return err;
}
-static int32
+static s32
wl_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
- int32 val = 0;
- int32 err = 0;
+ s32 val = 0;
+ s32 err = 0;
if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1)
val = WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED;
return err;
}
-static int32
+static s32
wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
- int32 val = 0;
- int32 err = 0;
+ s32 val = 0;
+ s32 err = 0;
switch (sme->auth_type) {
case NL80211_AUTHTYPE_OPEN_SYSTEM:
return err;
}
-static int32
+static s32
wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
- int32 pval = 0;
- int32 gval = 0;
- int32 err = 0;
+ s32 pval = 0;
+ s32 gval = 0;
+ s32 err = 0;
if (sme->crypto.n_ciphers_pairwise) {
switch (sme->crypto.ciphers_pairwise[0]) {
return err;
}
-static int32
+static s32
wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
- int32 val = 0;
- int32 err = 0;
+ s32 val = 0;
+ s32 err = 0;
if (sme->crypto.n_akm_suites) {
err = wl_dev_intvar_get(dev, "wpa_auth", &val);
return err;
}
-static int32
+static s32
wl_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
struct wl_wsec_key key;
- int32 val;
- int32 err = 0;
+ s32 val;
+ s32 err = 0;
WL_DBG(("key len (%d)\n", sme->key_len));
if (sme->key_len) {
return err;
}
-static int32
+static s32
wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct ieee80211_channel *chan = sme->channel;
struct wlc_ssid ssid;
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
if (unlikely(!sme->ssid)) {
return err;
}
-static int32
+static s32
wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
scb_val_t scbval;
bool act = FALSE;
- int32 err = 0;
+ s32 err = 0;
WL_DBG(("Reason %d\n", reason_code));
CHECK_SYS_UP();
return err;
}
-static int32
+static s32
wl_cfg80211_set_tx_power(struct wiphy *wiphy,
- enum nl80211_tx_power_setting type, int32 dbm)
+ enum nl80211_tx_power_setting type, s32 dbm)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
u16 txpwrmw;
- int32 err = 0;
- int32 disable = 0;
+ s32 err = 0;
+ s32 disable = 0;
CHECK_SYS_UP();
switch (type) {
else
txpwrmw = (u16) dbm;
err = wl_dev_intvar_set(ndev, "qtxpower",
- (int32) (bcm_mw_to_qdbm(txpwrmw)));
+ (s32) (bcm_mw_to_qdbm(txpwrmw)));
if (unlikely(err)) {
WL_ERR(("qtxpower error (%d)\n", err));
return err;
return err;
}
-static int32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, int32 *dbm)
+static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
- int32 txpwrdbm;
+ s32 txpwrdbm;
u8 result;
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
err = wl_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
return err;
}
result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE);
- *dbm = (int32) bcm_qdbm_to_mw(result);
+ *dbm = (s32) bcm_qdbm_to_mw(result);
return err;
}
-static int32
+static s32
wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx)
{
u32 index;
- int32 wsec;
- int32 err = 0;
+ s32 wsec;
+ s32 err = 0;
WL_DBG(("key index (%d)\n", key_idx));
CHECK_SYS_UP();
return err;
}
-static int32
+static s32
wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr, struct key_params *params)
{
struct wl_wsec_key key;
- int32 err = 0;
+ s32 err = 0;
memset(&key, 0, sizeof(key));
key.index = (u32) key_idx;
return err;
}
-static int32
+static s32
wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
struct key_params *params)
{
struct wl_wsec_key key;
- int32 val;
- int32 wsec;
- int32 err = 0;
+ s32 val;
+ s32 wsec;
+ s32 err = 0;
WL_DBG(("key index (%d)\n", key_idx));
CHECK_SYS_UP();
return err;
}
-static int32
+static s32
wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr)
{
struct wl_wsec_key key;
- int32 err = 0;
- int32 val;
- int32 wsec;
+ s32 err = 0;
+ s32 val;
+ s32 wsec;
CHECK_SYS_UP();
memset(&key, 0, sizeof(key));
return err;
}
-static int32
+static s32
wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr, void *cookie,
void (*callback) (void *cookie, struct key_params * params))
struct wl_wsec_key key;
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct wl_security *sec;
- int32 wsec;
- int32 err = 0;
+ s32 wsec;
+ s32 err = 0;
WL_DBG(("key index (%d)\n", key_idx));
CHECK_SYS_UP();
return err;
}
-static int32
+static s32
wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
struct net_device *dev, u8 key_idx)
{
return -EOPNOTSUPP;
}
-static int32
+static s32
wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
scb_val_t scb_val;
int rssi;
- int32 rate;
- int32 err = 0;
+ s32 rate;
+ s32 err = 0;
CHECK_SYS_UP();
if (unlikely
return err;
}
-static int32
+static s32
wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
- bool enabled, int32 timeout)
+ bool enabled, s32 timeout)
{
- int32 pm;
- int32 err = 0;
+ s32 pm;
+ s32 err = 0;
CHECK_SYS_UP();
pm = enabled ? PM_FAST : PM_OFF;
return ret;
}
-static int32
+static s32
wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr,
const struct cfg80211_bitrate_mask *mask)
{
struct wl_rateset rateset;
- int32 rate;
- int32 val;
- int32 err_bg;
- int32 err_a;
+ s32 rate;
+ s32 val;
+ s32 err_bg;
+ s32 err_a;
u32 legacy;
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
/* addr param is always NULL. ignore it */
return err;
}
-static int32 wl_cfg80211_resume(struct wiphy *wiphy)
+static s32 wl_cfg80211_resume(struct wiphy *wiphy)
{
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
wl_invoke_iscan(wiphy_to_wl(wiphy));
return err;
}
-static int32 wl_cfg80211_suspend(struct wiphy *wiphy)
+static s32 wl_cfg80211_suspend(struct wiphy *wiphy)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
return err;
}
-static __used int32
+static __used s32
wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
- int32 err)
+ s32 err)
{
s8 eabuf[ETHER_ADDR_STR_LEN];
int i, j;
return err;
}
-static int32
+static s32
wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
s8 eabuf[ETHER_ADDR_STR_LEN];
- int32 err = 0;
+ s32 err = 0;
int i;
CHECK_SYS_UP();
return err;
}
-static int32
+static s32
wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
s8 eabuf[ETHER_ADDR_STR_LEN];
struct _pmkid_list pmkid;
- int32 err = 0;
+ s32 err = 0;
int i;
CHECK_SYS_UP();
}
-static int32
+static s32
wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- int32 err = 0;
+ s32 err = 0;
CHECK_SYS_UP();
memset(wl->pmk_list, 0, sizeof(*wl->pmk_list));
.flush_pmksa = wl_cfg80211_flush_pmksa
};
-static int32 wl_mode_to_nl80211_iftype(int32 mode)
+static s32 wl_mode_to_nl80211_iftype(s32 mode)
{
- int32 err = 0;
+ s32 err = 0;
switch (mode) {
case WL_MODE_BSS:
return err;
}
-static struct wireless_dev *wl_alloc_wdev(int32 sizeof_iface,
+static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
struct device *dev)
{
struct wireless_dev *wdev;
- int32 err = 0;
+ s32 err = 0;
wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
if (unlikely(!wdev)) {
wl_to_wdev(wl) = NULL;
}
-static int32 wl_inform_bss(struct wl_priv *wl)
+static s32 wl_inform_bss(struct wl_priv *wl)
{
struct wl_scan_results *bss_list;
struct wl_bss_info *bi = NULL; /* must be initialized */
- int32 err = 0;
+ s32 err = 0;
int i;
bss_list = wl->bss_list;
return err;
}
-static int32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
+static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
{
struct wiphy *wiphy = wl_to_wiphy(wl);
struct ieee80211_mgmt *mgmt;
struct wl_scan_req *sr = wl_to_sr(wl);
u32 signal;
u32 freq;
- int32 err = 0;
+ s32 err = 0;
if (unlikely(dtoh32(bi->length) > WL_BSS_INFO_MAX)) {
WL_DBG(("Beacon is larger than buffer. Discarding\n"));
return FALSE;
}
-static int32
+static s32
wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
{
bool act;
- int32 err = 0;
+ s32 err = 0;
if (wl_is_linkup(wl, e)) {
wl_link_up(wl);
return err;
}
-static int32
+static s32
wl_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
{
bool act;
- int32 err = 0;
+ s32 err = 0;
wl_bss_roaming_done(wl, ndev, e, data);
act = TRUE;
return err;
}
-static __used int32
-wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, int32 len)
+static __used s32
+wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
{
struct wl_priv *wl = ndev_to_wl(dev);
u32 buflen;
return wl_dev_ioctl(dev, WLC_SET_VAR, wl->ioctl_buf, buflen);
}
-static int32
+static s32
wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
- int32 buf_len)
+ s32 buf_len)
{
struct wl_priv *wl = ndev_to_wl(dev);
u32 len;
- int32 err = 0;
+ s32 err = 0;
len = bcm_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(unlikely(!len));
return err;
}
-static int32 wl_get_assoc_ies(struct wl_priv *wl)
+static s32 wl_get_assoc_ies(struct wl_priv *wl)
{
struct net_device *ndev = wl_to_ndev(wl);
struct wl_assoc_ielen *assoc_info;
struct wl_connect_info *conn_info = wl_to_conn(wl);
u32 req_len;
u32 resp_len;
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
WL_ASSOC_INFO_MAX);
return err;
}
-static int32 wl_update_bss_info(struct wl_priv *wl)
+static s32 wl_update_bss_info(struct wl_priv *wl)
{
struct cfg80211_bss *bss;
struct wl_bss_info *bi;
struct wlc_ssid *ssid;
- int32 err = 0;
+ s32 err = 0;
if (wl_is_ibssmode(wl))
return err;
return err;
}
-static int32
+static s32
wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
- int32 err = 0;
+ s32 err = 0;
wl_get_assoc_ies(wl);
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
return err;
}
-static int32
+static s32
wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data, bool completed)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
- int32 err = 0;
+ s32 err = 0;
wl_get_assoc_ies(wl);
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
return err;
}
-static int32
+static s32
wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
{
return 0;
}
-static int32
+static s32
wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
{
struct channel_info channel_inform;
struct wl_scan_results *bss_list;
u32 len = WL_SCAN_BUF_MAX;
- int32 err = 0;
+ s32 err = 0;
if (wl->iscan_on && wl->iscan_kickstart)
return wl_wakeup_iscan(wl_to_iscan(wl));
el->handler[WLC_E_SET_SSID] = wl_notify_connect_status;
}
-static int32 wl_init_priv_mem(struct wl_priv *wl)
+static s32 wl_init_priv_mem(struct wl_priv *wl)
{
wl->scan_results = (void *)kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
if (unlikely(!wl->scan_results)) {
wl->pmk_list = NULL;
}
-static int32 wl_create_event_handler(struct wl_priv *wl)
+static s32 wl_create_event_handler(struct wl_priv *wl)
{
sema_init(&wl->event_sync, 0);
init_completion(&wl->event_exit);
wl->iscan_kickstart = FALSE;
}
-static int32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
+static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
{
if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
WL_DBG(("wake up iscan\n"));
return -EIO;
}
-static int32
+static s32
wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
struct wl_scan_results **bss_list)
{
struct wl_iscan_results list;
struct wl_scan_results *results;
struct wl_iscan_results *list_buf;
- int32 err = 0;
+ s32 err = 0;
memset(iscan->scan_buf, 0, WL_ISCAN_BUF_MAX);
list_buf = (struct wl_iscan_results *)iscan->scan_buf;
return err;
}
-static int32 wl_iscan_done(struct wl_priv *wl)
+static s32 wl_iscan_done(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
- int32 err = 0;
+ s32 err = 0;
iscan->state = WL_ISCAN_STATE_IDLE;
rtnl_lock();
return err;
}
-static int32 wl_iscan_pending(struct wl_priv *wl)
+static s32 wl_iscan_pending(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
- int32 err = 0;
+ s32 err = 0;
/* Reschedule the timer */
mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
return err;
}
-static int32 wl_iscan_inprogress(struct wl_priv *wl)
+static s32 wl_iscan_inprogress(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
- int32 err = 0;
+ s32 err = 0;
rtnl_lock();
wl_inform_bss(wl);
return err;
}
-static int32 wl_iscan_aborted(struct wl_priv *wl)
+static s32 wl_iscan_aborted(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
- int32 err = 0;
+ s32 err = 0;
iscan->state = WL_ISCAN_STATE_IDLE;
rtnl_lock();
return err;
}
-static int32 wl_iscan_thread(void *data)
+static s32 wl_iscan_thread(void *data)
{
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
}
}
-static int32 wl_invoke_iscan(struct wl_priv *wl)
+static s32 wl_invoke_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
int err = 0;
el->handler[WL_SCAN_RESULTS_NO_MEM] = wl_iscan_aborted;
}
-static int32 wl_init_iscan(struct wl_priv *wl)
+static s32 wl_init_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
int err = 0;
0 means nothing was loaded yet */
}
-static int32 wl_init_priv(struct wl_priv *wl)
+static s32 wl_init_priv(struct wl_priv *wl)
{
struct wiphy *wiphy = wl_to_wiphy(wl);
- int32 err = 0;
+ s32 err = 0;
wl->scan_request = NULL;
wl->pwr_save = !!(wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT);
wl_deinit_priv_mem(wl);
}
-int32 wl_cfg80211_attach(struct net_device *ndev, void *data)
+s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
{
struct wireless_dev *wdev;
struct wl_priv *wl;
struct wl_iface *ci;
- int32 err = 0;
+ s32 err = 0;
if (unlikely(!ndev)) {
WL_ERR(("ndev is invaild\n"));
up(&wl->event_sync);
}
-static int32 wl_event_handler(void *data)
+static s32 wl_event_handler(void *data)
{
struct wl_priv *wl = (struct wl_priv *)data;
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
** push event to tail of the queue
*/
-static int32
+static s32
wl_enq_event(struct wl_priv *wl, u32 event, const wl_event_msg_t *msg,
void *data)
{
struct wl_event_q *e;
- int32 err = 0;
+ s32 err = 0;
e = kzalloc(sizeof(struct wl_event_q), GFP_KERNEL);
if (unlikely(!e)) {
return cfg80211_sdio_func;
}
-static int32 wl_dongle_mode(struct net_device *ndev, int32 iftype)
+static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
{
- int32 infra = 0;
- int32 ap = 0;
- int32 err = 0;
+ s32 infra = 0;
+ s32 ap = 0;
+ s32 err = 0;
switch (iftype) {
case NL80211_IFTYPE_MONITOR:
}
#ifndef EMBEDDED_PLATFORM
-static int32 wl_dongle_country(struct net_device *ndev, u8 ccode)
+static s32 wl_dongle_country(struct net_device *ndev, u8 ccode)
{
- int32 err = 0;
+ s32 err = 0;
return err;
}
-static int32 wl_dongle_up(struct net_device *ndev, u32 up)
+static s32 wl_dongle_up(struct net_device *ndev, u32 up)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_ioctl(ndev, WLC_UP, &up, sizeof(up));
if (unlikely(err)) {
return err;
}
-static int32 wl_dongle_power(struct net_device *ndev, u32 power_mode)
+static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_ioctl(ndev, WLC_SET_PM, &power_mode, sizeof(power_mode));
if (unlikely(err)) {
return err;
}
-static int32
+static s32
wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
{
s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
- int32 err = 0;
+ s32 err = 0;
/* Match Host and Dongle rx alignment */
bcm_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
return err;
}
-static int32
+static s32
wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
{
s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
- int32 err = 0;
+ s32 err = 0;
/* Setup timeout if Beacons are lost and roam is
off to report link down */
return err;
}
-static int32 wl_dongle_eventmsg(struct net_device *ndev)
+static s32 wl_dongle_eventmsg(struct net_device *ndev)
{
s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
s8 eventmask[WL_EVENTING_MASK_LEN];
- int32 err = 0;
+ s32 err = 0;
/* Setup event_msgs */
bcm_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
return err;
}
-static int32
-wl_dongle_scantime(struct net_device *ndev, int32 scan_assoc_time,
- int32 scan_unassoc_time)
+static s32
+wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
+ s32 scan_unassoc_time)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_ioctl(ndev, WLC_SET_SCAN_CHANNEL_TIME, &scan_assoc_time,
sizeof(scan_assoc_time));
return err;
}
-static int32
-wl_dongle_offload(struct net_device *ndev, int32 arpoe, int32 arp_ol)
+static s32
+wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
{
s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
- int32 err = 0;
+ s32 err = 0;
/* Set ARP offload */
bcm_mkiovar("arpoe", (char *)&arpoe, 4, iovbuf, sizeof(iovbuf));
return err;
}
-static int32 wl_pattern_atoh(s8 *src, s8 *dst)
+static s32 wl_pattern_atoh(s8 *src, s8 *dst)
{
#define strtoul(nptr, endptr, base) bcm_strtoul((nptr), (endptr), (base))
int i;
return i;
}
-static int32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
+static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
{
s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
const s8 *str;
struct wl_pkt_filter pkt_filter;
struct wl_pkt_filter *pkt_filterp;
- int32 buf_len;
- int32 str_len;
+ s32 buf_len;
+ s32 str_len;
u32 mask_size;
u32 pattern_size;
s8 buf[256];
- int32 err = 0;
+ s32 err = 0;
/* add a default packet filter pattern */
str = "pkt_filter_add";
}
#endif /* !EMBEDDED_PLATFORM */
-int32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
+s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
{
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
#endif
struct net_device *ndev;
struct wireless_dev *wdev;
- int32 err = 0;
+ s32 err = 0;
if (wl->dongle_up)
return err;
}
-static int32 wl_update_wiphybands(struct wl_priv *wl)
+static s32 wl_update_wiphybands(struct wl_priv *wl)
{
struct wiphy *wiphy;
- int32 phy_list;
+ s32 phy_list;
s8 phy;
- int32 err = 0;
+ s32 err = 0;
err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
sizeof(phy_list));
return err;
}
-static int32 __wl_cfg80211_up(struct wl_priv *wl)
+static s32 __wl_cfg80211_up(struct wl_priv *wl)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_config_dongle(wl, FALSE);
if (unlikely(err))
return err;
}
-static int32 __wl_cfg80211_down(struct wl_priv *wl)
+static s32 __wl_cfg80211_down(struct wl_priv *wl)
{
- int32 err = 0;
+ s32 err = 0;
/* Check if cfg80211 interface is already down */
if (!test_bit(WL_STATUS_READY, &wl->status))
return err;
}
-int32 wl_cfg80211_up(void)
+s32 wl_cfg80211_up(void)
{
struct wl_priv *wl;
- int32 err = 0;
+ s32 err = 0;
wl = WL_PRIV_GET();
mutex_lock(&wl->usr_sync);
return err;
}
-int32 wl_cfg80211_down(void)
+s32 wl_cfg80211_down(void)
{
struct wl_priv *wl;
- int32 err = 0;
+ s32 err = 0;
wl = WL_PRIV_GET();
mutex_lock(&wl->usr_sync);
return err;
}
-static int32 wl_dongle_probecap(struct wl_priv *wl)
+static s32 wl_dongle_probecap(struct wl_priv *wl)
{
- int32 err = 0;
+ s32 err = 0;
err = wl_update_wiphybands(wl);
if (unlikely(err))
return err;
}
-static void *wl_read_prof(struct wl_priv *wl, int32 item)
+static void *wl_read_prof(struct wl_priv *wl, s32 item)
{
switch (item) {
case WL_PROF_SEC:
return NULL;
}
-static int32
+static s32
wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e, void *data,
- int32 item)
+ s32 item)
{
- int32 err = 0;
+ s32 err = 0;
struct wlc_ssid *ssid;
switch (item) {
ie->offset = 0;
}
-static int32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
+static s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
{
struct wl_ie *ie = wl_to_ie(wl);
- int32 err = 0;
+ s32 err = 0;
if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
WL_ERR(("ei crosses buffer boundary\n"));
return err;
}
-static int32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size)
+static s32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size)
{
struct wl_ie *ie = wl_to_ie(wl);
- int32 err = 0;
+ s32 err = 0;
if (unlikely(ie->offset + ie_size > WL_TLV_INFO_MAX)) {
WL_ERR(("ei_stream crosses buffer boundary\n"));
return err;
}
-static int32 wl_cp_ie(struct wl_priv *wl, u8 *dst, u16 dst_size)
+static s32 wl_cp_ie(struct wl_priv *wl, u8 *dst, u16 dst_size)
{
struct wl_ie *ie = wl_to_ie(wl);
- int32 err = 0;
+ s32 err = 0;
if (unlikely(ie->offset > dst_size)) {
WL_ERR(("dst_size is not enough\n"));
return dev->driver_data;
}
-int32 wl_cfg80211_read_fw(s8 *buf, u32 size)
+s32 wl_cfg80211_read_fw(s8 *buf, u32 size)
{
const struct firmware *fw_entry;
struct wl_priv *wl;
{
struct wl_priv *wl;
const struct firmware *fw_entry = NULL;
- int32 err = 0;
+ s32 err = 0;
WL_DBG(("file name : \"%s\"\n", file_name));
wl = WL_PRIV_GET();
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);
};
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 */
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;
/* 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 */
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 */
#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
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;
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);
*/
/* 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);
"u8", \
"s16", \
"u16", \
- "int32", \
+ "s32", \
"u32", \
"buffer", \
"" }
#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);
s16 qm_norm16(s16 op);
-s16 qm_norm32(int32 op);
+s16 qm_norm32(s32 op);
s16 qm_div_s(s16 num, s16 denom);
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__ */
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
#undef TYPEDEF_UINT
#undef TYPEDEF_UINTPTR
-#undef TYPEDEF_INT32
/*
* Including the bcmdefs.h here, to make sure everyone including typedefs.h
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;
* 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
*
/* 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 */
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
*/
}
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;
}
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);
}
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)
29
};
-void wlc_phy_cordic(fixed theta, cint32 *val)
+void wlc_phy_cordic(fixed theta, cs32 *val)
{
fixed angle, valtmp;
unsigned iter;
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);
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);
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
#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
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;
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);
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);
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,
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;
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);
}
}
-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);
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;
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;
}
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;
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;
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;
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))
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 +
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;
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;
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;
}
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);
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))
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;
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);
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;
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
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;
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;
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;
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] = {
{
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);
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,
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);
}
-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;
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;
}
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;
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);
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;
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;
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];
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:
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},
{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;
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;
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;
}
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;
}
}
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;
#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 =
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;
}
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;
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++) {
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;
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;
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;
}
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)) {
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;
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));
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;
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 ==
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);
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))
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;
u32 locomp;
u16 tmpval;
u8 tx_pwr_ctrl_state;
- int32 rfpwr_offset;
+ s32 rfpwr_offset;
u16 regval[2];
if (pi->phyhang_avoid)
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;
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;
/* 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);
}
{
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) {
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;
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;
}
case IOV_GVAL(IOV_MPC):
- *ret_int_ptr = (int32) wlc->mpc;
+ *ret_int_ptr = (s32) wlc->mpc;
break;
case IOV_SVAL(IOV_MPC):
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;
/* 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 */
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);
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) */
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);
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;
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)) {
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;
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;
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);
u32 w32;
uint funcid;
uint cisnum;
- int32 boardnum;
+ s32 boardnum;
int err;
bool standard_cis;
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;
}
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;
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);
}
/*
*/
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);
}
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;
*/
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);
}
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;
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;
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;
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;
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;
}
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;
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);
}
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) {
{
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++) {
/*
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;
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);
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);
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;
}
/*
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);
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);
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);
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.
/* 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);
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);
/* 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. */
}