Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219819
b: refs/heads/master
c: ca8c1e5
h: refs/heads/master
i:
  219817: 490d4a6
  219815: 96a4215
v: v3
  • Loading branch information
Jason Cooper authored and Greg Kroah-Hartman committed Sep 14, 2010
1 parent 4d644c9 commit 5de6983
Show file tree
Hide file tree
Showing 22 changed files with 363 additions and 254 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90ea22962c5160812c601a115fb7b80c60d49fad
refs/heads/master: ca8c1e5990926406708d99fe1ce2a6f5e12f9033
25 changes: 16 additions & 9 deletions trunk/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ int phy_getintvar(phy_info_t *pi, const char *name)
{
char *val;

if ((val = PHY_GETVAR(pi, name)) == NULL)
val = PHY_GETVAR(pi, name);
if (val == NULL)
return 0;

return bcm_strtoul(val, NULL, 0);
Expand Down Expand Up @@ -549,8 +550,8 @@ shared_phy_t *BCMATTACHFN(wlc_phy_shared_attach) (shared_phy_params_t *shp)
{
shared_phy_t *sh;

if ((sh =
(shared_phy_t *) MALLOC(shp->osh, sizeof(shared_phy_t))) == NULL) {
sh = (shared_phy_t *) MALLOC(shp->osh, sizeof(shared_phy_t));
if (sh == NULL) {
return NULL;
}
bzero((char *)sh, sizeof(shared_phy_t));
Expand Down Expand Up @@ -619,14 +620,16 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
}
}

if ((sflags & SISF_DB_PHY) && (pi = sh->phy_head)) {
pi = sh->phy_head;
if ((sflags & SISF_DB_PHY) && pi) {

wlapi_bmac_corereset(pi->sh->physhim, pi->pubpi.coreflags);
pi->refcnt++;
return &pi->pubpi_ro;
}

if ((pi = (phy_info_t *) MALLOC(osh, sizeof(phy_info_t))) == NULL) {
pi = (phy_info_t *) MALLOC(osh, sizeof(phy_info_t));
if (pi == NULL) {
return NULL;
}
bzero((char *)pi, sizeof(phy_info_t));
Expand Down Expand Up @@ -744,9 +747,10 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,

if (ISNPHY(pi)) {

if (!(pi->phycal_timer = wlapi_init_timer(pi->sh->physhim,
pi->phycal_timer = wlapi_init_timer(pi->sh->physhim,
wlc_phy_timercb_phycal,
pi, "phycal"))) {
pi, "phycal");
if (!pi->phycal_timer) {
goto err;
}

Expand Down Expand Up @@ -3014,9 +3018,12 @@ void wlc_phy_BSSinit(wlc_phy_t *pih, bool bonlyap, int rssi)
void
wlc_phy_papd_decode_epsilon(uint32 epsilon, int32 *eps_real, int32 *eps_imag)
{
if ((*eps_imag = (epsilon >> 13)) > 0xfff)
*eps_imag = (epsilon >> 13);
if (*eps_imag > 0xfff)
*eps_imag -= 0x2000;
if ((*eps_real = (epsilon & 0x1fff)) > 0xfff)

*eps_real = (epsilon & 0x1fff);
if (*eps_real > 0xfff)
*eps_real -= 0x2000;
}

Expand Down
18 changes: 12 additions & 6 deletions trunk/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,8 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
if (NORADIO_ENAB(pi->pubpi))
return;

if (NULL == (values_to_save = MALLOC(pi->sh->osh, sizeof(uint16) * 20))) {
values_to_save = MALLOC(pi->sh->osh, sizeof(uint16) * 20);
if (NULL == values_to_save) {
return;
}

Expand Down Expand Up @@ -3203,7 +3204,8 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, uint16 num_samps)

wlc_lcnphy_set_rx_iq_comp(pi, 0, 0);

if (!(result = wlc_lcnphy_rx_iq_est(pi, num_samps, 32, &iq_est)))
result = wlc_lcnphy_rx_iq_est(pi, num_samps, 32, &iq_est);
if (!result)
goto cleanup;

iq = (int32) iq_est.iq_prod;
Expand Down Expand Up @@ -3287,7 +3289,8 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
int16 *ptr;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;

if (NULL == (ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131))) {
ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131);
if (NULL == ptr) {
return FALSE;
}
if (module == 2) {
Expand Down Expand Up @@ -3587,8 +3590,9 @@ void wlc_lcnphy_get_tssi(phy_info_t *pi, int8 *ofdm_pwr, int8 *cck_pwr)
{
int8 cck_offset;
uint16 status;
status = (read_phy_reg(pi, 0x4ab));
if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi) &&
((status = (read_phy_reg(pi, 0x4ab))) & (0x1 << 15))) {
(status & (0x1 << 15))) {
*ofdm_pwr = (int8) (((read_phy_reg(pi, 0x4ab) & (0x1ff << 0))
>> 0) >> 1);

Expand Down Expand Up @@ -4040,11 +4044,13 @@ wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
uint16 *phy_c32;
phy_c21 = 0;
phy_c10 = phy_c13 = phy_c14 = phy_c8 = 0;
if (NULL == (ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131))) {
ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131);
if (NULL == ptr) {
return;
}

if (NULL == (phy_c32 = MALLOC(pi->sh->osh, sizeof(uint16) * 20))) {
phy_c32 = MALLOC(pi->sh->osh, sizeof(uint16) * 20);
if (NULL == phy_c32) {
return;
}
phy_c26 = read_phy_reg(pi, 0x6da);
Expand Down
22 changes: 9 additions & 13 deletions trunk/drivers/staging/brcm80211/phy/wlc_phy_n.c
Original file line number Diff line number Diff line change
Expand Up @@ -22357,9 +22357,8 @@ wlc_phy_gen_load_samples_nphy(phy_info_t *pi, uint32 f_kHz, uint16 max_val,
tbl_len = (phy_bw << 1);
}

if ((tone_buf =
(cint32 *) MALLOC(pi->sh->osh,
sizeof(cint32) * tbl_len)) == NULL) {
tone_buf = (cint32 *) MALLOC(pi->sh->osh, sizeof(cint32) * tbl_len);
if (tone_buf == NULL) {
return 0;
}

Expand Down Expand Up @@ -22393,9 +22392,9 @@ wlc_phy_tx_tone_nphy(phy_info_t *pi, uint32 f_kHz, uint16 max_val,
uint16 loops = 0xffff;
uint16 wait = 0;

if ((num_samps =
wlc_phy_gen_load_samples_nphy(pi, f_kHz, max_val,
dac_test_mode)) == 0) {
num_samps =
wlc_phy_gen_load_samples_nphy(pi, f_kHz, max_val, dac_test_mode);
if (num_samps == 0) {
return BCME_ERROR;
}

Expand All @@ -22412,9 +22411,8 @@ wlc_phy_loadsampletable_nphy(phy_info_t *pi, cint32 *tone_buf,
uint16 t;
uint32 *data_buf = NULL;

if ((data_buf =
(uint32 *) MALLOC(pi->sh->osh,
sizeof(uint32) * num_samps)) == NULL) {
data_buf = (uint32 *) MALLOC(pi->sh->osh, sizeof(uint32) * num_samps);
if (data_buf == NULL) {
return;
}

Expand Down Expand Up @@ -26728,10 +26726,8 @@ wlc_phy_a1_nphy(phy_info_t *pi, uint8 core, uint32 winsz, uint32 start,
ASSERT(end > start);
ASSERT(end < NPHY_PAPD_EPS_TBL_SIZE);

if (NULL ==
(buf =
MALLOC(pi->sh->osh,
2 * sizeof(uint32) * NPHY_PAPD_EPS_TBL_SIZE))) {
buf = MALLOC(pi->sh->osh, 2 * sizeof(uint32) * NPHY_PAPD_EPS_TBL_SIZE);
if (NULL == buf) {
return;
}

Expand Down
32 changes: 19 additions & 13 deletions trunk/drivers/staging/brcm80211/sys/wl_mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,8 @@ static wl_info_t *wl_attach(uint16 vendor, uint16 device, ulong regs,
btparam = wl->rpc;
} else
#endif
if ((wl->regsva = ioremap_nocache(base_addr, PCI_BAR0_WINSZ)) == NULL) {
wl->regsva = ioremap_nocache(base_addr, PCI_BAR0_WINSZ);
if (wl->regsva == NULL) {
WL_ERROR(("wl%d: ioremap() failed\n", unit));
goto fail;
}
Expand Down Expand Up @@ -993,8 +994,8 @@ static wl_info_t *wl_attach(uint16 vendor, uint16 device, ulong regs,
#endif /* BCMDBG */
printf("\n");

if ((wl->proc_entry =
create_proc_entry(PROC_ENTRY_NAME, 0644, NULL)) == NULL) {
wl->proc_entry = create_proc_entry(PROC_ENTRY_NAME, 0644, NULL);
if (wl->proc_entry == NULL) {
WL_ERROR(("create_proc_entry failed *******\n"));
ASSERT(0);
} else {
Expand All @@ -1003,7 +1004,8 @@ static wl_info_t *wl_attach(uint16 vendor, uint16 device, ulong regs,
wl->proc_entry->data = wl;
/* wl->proc_entry->owner = THIS_MODULE; */

if ((wl->ioctlbuf = (char *)vmalloc(PAGE_SIZE)) == NULL) {
wl->ioctlbuf = (char *)vmalloc(PAGE_SIZE);
if (wl->ioctlbuf == NULL) {
WL_ERROR(("%s: Vmalloc failed\n", __func__));
}
wl->ioctlbuf_sz = PAGE_SIZE;
Expand Down Expand Up @@ -1145,10 +1147,9 @@ static void *wl_dbus_probe_cb(void *arg, const char *desc, uint32 bustype,
wl_info_t *wl;
WL_ERROR(("%s:\n", __func__));

if (!
(wl =
wl_attach(BCM_DNGL_VID, BCM_DNGL_BDC_PID, (ulong) NULL, RPC_BUS,
NULL, 0))) {
wl = wl_attach(BCM_DNGL_VID, BCM_DNGL_BDC_PID, (ulong) NULL, RPC_BUS,
NULL, 0);
if (!wl) {
WL_ERROR(("%s: wl_attach failed\n", __func__));
}

Expand Down Expand Up @@ -1656,7 +1657,8 @@ static int __init wl_module_init(void)
#endif /* BCMDBG */

#ifndef BCMSDIO
if (!(error = pci_module_init(&wl_pci_driver)))
error = pci_module_init(&wl_pci_driver);
if (!error)
return 0;

#endif /* !BCMSDIO */
Expand Down Expand Up @@ -1827,7 +1829,8 @@ wl_schedule_task(wl_info_t *wl, void (*fn) (struct wl_task *task),

WL_TRACE(("wl%d: wl_schedule_task\n", wl->pub->unit));

if (!(task = osl_malloc(wl->osh, sizeof(wl_task_t)))) {
task = osl_malloc(wl->osh, sizeof(wl_task_t));
if (!task) {
WL_ERROR(("wl%d: wl_schedule_task: out of memory, malloced %d bytes\n", wl->pub->unit, osl_malloced(wl->osh)));
return -ENOMEM;
}
Expand Down Expand Up @@ -1959,7 +1962,8 @@ irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id)
WL_ISRLOCK(wl, flags);

/* call common first level interrupt handler */
if ((ours = wlc_isr(wl->wlc, &wantdpc))) {
ours = wlc_isr(wl->wlc, &wantdpc);
if (ours) {
/* if more to do... */
if (wantdpc) {

Expand Down Expand Up @@ -2079,7 +2083,8 @@ wl_timer_t *wl_init_timer(wl_info_t *wl, void (*fn) (void *arg), void *arg,
{
wl_timer_t *t;

if (!(t = osl_malloc(wl->osh, sizeof(wl_timer_t)))) {
t = osl_malloc(wl->osh, sizeof(wl_timer_t));
if (!t) {
WL_ERROR(("wl%d: wl_init_timer: out of memory, malloced %d bytes\n", wl->pub->unit, osl_malloced(wl->osh)));
return 0;
}
Expand All @@ -2096,7 +2101,8 @@ wl_timer_t *wl_init_timer(wl_info_t *wl, void (*fn) (void *arg), void *arg,
wl->timers = t;

#ifdef BCMDBG
if ((t->name = osl_malloc(wl->osh, strlen(name) + 1)))
t->name = osl_malloc(wl->osh, strlen(name) + 1);
if (t->name)
strcpy(t->name, name);
#endif

Expand Down
Loading

0 comments on commit 5de6983

Please sign in to comment.