Commit 8ea54c9f authored by Henry Ptasinski's avatar Henry Ptasinski Committed by Greg Kroah-Hartman

staging: brcm80211: fix for 'remove unnecessary braces' checkpatch warning

Removed unnecessary braces in single-statement blocks. Used the tools
'uncrustify' and 'coccinelle' to accomplish this.
Signed-off-by: default avatarHenry Ptasinski <henryp@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5973f660
...@@ -218,10 +218,9 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd) ...@@ -218,10 +218,9 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
sdio_claim_host(gInstance->func[1]); sdio_claim_host(gInstance->func[1]);
err_ret = sdio_enable_func(gInstance->func[1]); err_ret = sdio_enable_func(gInstance->func[1]);
sdio_release_host(gInstance->func[1]); sdio_release_host(gInstance->func[1]);
if (err_ret) { if (err_ret)
sd_err(("brcmf_sdioh_enablefuncs: Failed to enable F1 " sd_err(("brcmf_sdioh_enablefuncs: Failed to enable F1 "
"Err: 0x%08x\n", err_ret)); "Err: 0x%08x\n", err_ret));
}
return false; return false;
} }
...@@ -763,35 +762,32 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw, ...@@ -763,35 +762,32 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
sdio_claim_host(gInstance->func[func]); sdio_claim_host(gInstance->func[func]);
if (rw) { /* CMD52 Write */ if (rw) { /* CMD52 Write */
if (nbytes == 4) { if (nbytes == 4)
sdio_writel(gInstance->func[func], *word, addr, sdio_writel(gInstance->func[func], *word, addr,
&err_ret); &err_ret);
} else if (nbytes == 2) { else if (nbytes == 2)
sdio_writew(gInstance->func[func], (*word & 0xFFFF), sdio_writew(gInstance->func[func], (*word & 0xFFFF),
addr, &err_ret); addr, &err_ret);
} else { else
sd_err(("%s: Invalid nbytes: %d\n", __func__, nbytes)); sd_err(("%s: Invalid nbytes: %d\n", __func__, nbytes));
}
} else { /* CMD52 Read */ } else { /* CMD52 Read */
if (nbytes == 4) { if (nbytes == 4)
*word = *word =
sdio_readl(gInstance->func[func], addr, &err_ret); sdio_readl(gInstance->func[func], addr, &err_ret);
} else if (nbytes == 2) { else if (nbytes == 2)
*word = *word =
sdio_readw(gInstance->func[func], addr, sdio_readw(gInstance->func[func], addr,
&err_ret) & 0xFFFF; &err_ret) & 0xFFFF;
} else { else
sd_err(("%s: Invalid nbytes: %d\n", __func__, nbytes)); sd_err(("%s: Invalid nbytes: %d\n", __func__, nbytes));
} }
}
/* Release host controller */ /* Release host controller */
sdio_release_host(gInstance->func[func]); sdio_release_host(gInstance->func[func]);
if (err_ret) { if (err_ret)
sd_err(("brcmf: Failed to %s word, Err: 0x%08x\n", sd_err(("brcmf: Failed to %s word, Err: 0x%08x\n",
rw ? "Write" : "Read", err_ret)); rw ? "Write" : "Read", err_ret));
}
return err_ret; return err_ret;
} }
......
...@@ -284,18 +284,17 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q, ...@@ -284,18 +284,17 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
/* Evict packet according to discard policy */ /* Evict packet according to discard policy */
p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) : p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) :
brcmu_pktq_pdeq_tail(q, eprec); brcmu_pktq_pdeq_tail(q, eprec);
if (p == NULL) { if (p == NULL)
BRCMF_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.", BRCMF_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
__func__, discard_oldest)); __func__, discard_oldest));
}
brcmu_pkt_buf_free_skb(p); brcmu_pkt_buf_free_skb(p);
} }
/* Enqueue */ /* Enqueue */
p = brcmu_pktq_penq(q, prec, pkt); p = brcmu_pktq_penq(q, prec, pkt);
if (p == NULL) { if (p == NULL)
BRCMF_ERROR(("%s: brcmu_pktq_penq() failed.", __func__)); BRCMF_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
}
return p != NULL; return p != NULL;
} }
...@@ -542,20 +541,19 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) ...@@ -542,20 +541,19 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
case BRCMF_E_ASSOC: case BRCMF_E_ASSOC:
case BRCMF_E_REASSOC: case BRCMF_E_REASSOC:
if (status == BRCMF_E_STATUS_SUCCESS) { if (status == BRCMF_E_STATUS_SUCCESS)
BRCMF_EVENT(("MACEVENT: %s, MAC %s, SUCCESS\n", BRCMF_EVENT(("MACEVENT: %s, MAC %s, SUCCESS\n",
event_name, eabuf)); event_name, eabuf));
} else if (status == BRCMF_E_STATUS_TIMEOUT) { else if (status == BRCMF_E_STATUS_TIMEOUT)
BRCMF_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n", BRCMF_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n",
event_name, eabuf)); event_name, eabuf));
} else if (status == BRCMF_E_STATUS_FAIL) { else if (status == BRCMF_E_STATUS_FAIL)
BRCMF_EVENT(("MACEVENT: %s, MAC %s, FAILURE," BRCMF_EVENT(("MACEVENT: %s, MAC %s, FAILURE,"
" reason %d\n", event_name, eabuf, " reason %d\n", event_name, eabuf,
(int)reason)); (int)reason));
} else { else
BRCMF_EVENT(("MACEVENT: %s, MAC %s, unexpected status " BRCMF_EVENT(("MACEVENT: %s, MAC %s, unexpected status "
"%d\n", event_name, eabuf, (int)status)); "%d\n", event_name, eabuf, (int)status));
}
break; break;
case BRCMF_E_DEAUTH_IND: case BRCMF_E_DEAUTH_IND:
...@@ -574,16 +572,16 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) ...@@ -574,16 +572,16 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
sprintf(err_msg, "AUTH unknown: %d", (int)auth_type); sprintf(err_msg, "AUTH unknown: %d", (int)auth_type);
auth_str = err_msg; auth_str = err_msg;
} }
if (event_type == BRCMF_E_AUTH_IND) { if (event_type == BRCMF_E_AUTH_IND)
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name, BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name,
eabuf, auth_str)); eabuf, auth_str));
} else if (status == BRCMF_E_STATUS_SUCCESS) { else if (status == BRCMF_E_STATUS_SUCCESS)
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n", BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n",
event_name, eabuf, auth_str)); event_name, eabuf, auth_str));
} else if (status == BRCMF_E_STATUS_TIMEOUT) { else if (status == BRCMF_E_STATUS_TIMEOUT)
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n", BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
event_name, eabuf, auth_str)); event_name, eabuf, auth_str));
} else if (status == BRCMF_E_STATUS_FAIL) { else if (status == BRCMF_E_STATUS_FAIL) {
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, " BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, "
"reason %d\n", "reason %d\n",
event_name, eabuf, auth_str, (int)reason)); event_name, eabuf, auth_str, (int)reason));
...@@ -594,29 +592,27 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) ...@@ -594,29 +592,27 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
case BRCMF_E_JOIN: case BRCMF_E_JOIN:
case BRCMF_E_ROAM: case BRCMF_E_ROAM:
case BRCMF_E_SET_SSID: case BRCMF_E_SET_SSID:
if (status == BRCMF_E_STATUS_SUCCESS) { if (status == BRCMF_E_STATUS_SUCCESS)
BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name,
eabuf)); eabuf));
} else if (status == BRCMF_E_STATUS_FAIL) { else if (status == BRCMF_E_STATUS_FAIL)
BRCMF_EVENT(("MACEVENT: %s, failed\n", event_name)); BRCMF_EVENT(("MACEVENT: %s, failed\n", event_name));
} else if (status == BRCMF_E_STATUS_NO_NETWORKS) { else if (status == BRCMF_E_STATUS_NO_NETWORKS)
BRCMF_EVENT(("MACEVENT: %s, no networks found\n", BRCMF_EVENT(("MACEVENT: %s, no networks found\n",
event_name)); event_name));
} else { else
BRCMF_EVENT(("MACEVENT: %s, unexpected status %d\n", BRCMF_EVENT(("MACEVENT: %s, unexpected status %d\n",
event_name, (int)status)); event_name, (int)status));
}
break; break;
case BRCMF_E_BEACON_RX: case BRCMF_E_BEACON_RX:
if (status == BRCMF_E_STATUS_SUCCESS) { if (status == BRCMF_E_STATUS_SUCCESS)
BRCMF_EVENT(("MACEVENT: %s, SUCCESS\n", event_name)); BRCMF_EVENT(("MACEVENT: %s, SUCCESS\n", event_name));
} else if (status == BRCMF_E_STATUS_FAIL) { else if (status == BRCMF_E_STATUS_FAIL)
BRCMF_EVENT(("MACEVENT: %s, FAIL\n", event_name)); BRCMF_EVENT(("MACEVENT: %s, FAIL\n", event_name));
} else { else
BRCMF_EVENT(("MACEVENT: %s, status %d\n", event_name, BRCMF_EVENT(("MACEVENT: %s, status %d\n", event_name,
status)); status));
}
break; break;
case BRCMF_E_LINK: case BRCMF_E_LINK:
...@@ -1112,11 +1108,10 @@ int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr) ...@@ -1112,11 +1108,10 @@ int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
if (drvr->country_code[0] != 0) { if (drvr->country_code[0] != 0) {
if (brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_COUNTRY, if (brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_COUNTRY,
drvr->country_code, drvr->country_code,
sizeof(drvr->country_code)) < 0) { sizeof(drvr->country_code)) < 0)
BRCMF_ERROR(("%s: country code setting failed\n", BRCMF_ERROR(("%s: country code setting failed\n",
__func__)); __func__));
} }
}
/* query for 'ver' to get version info from firmware */ /* query for 'ver' to get version info from firmware */
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
......
...@@ -412,12 +412,11 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a ...@@ -412,12 +412,11 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a
ioc.set = true; ioc.set = true;
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len); ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) { if (ret < 0)
BRCMF_ERROR(("%s: set cur_etheraddr failed\n", BRCMF_ERROR(("%s: set cur_etheraddr failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx))); brcmf_ifname(&drvr_priv->pub, ifidx)));
} else { else
memcpy(drvr_priv->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN); memcpy(drvr_priv->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
}
return ret; return ret;
} }
...@@ -771,9 +770,9 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb, ...@@ -771,9 +770,9 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
drvr->dstats.rx_bytes += skb->len; drvr->dstats.rx_bytes += skb->len;
drvr->rx_packets++; /* Local count */ drvr->rx_packets++; /* Local count */
if (in_interrupt()) { if (in_interrupt())
netif_rx(skb); netif_rx(skb);
} else { else
/* If the receive is not processed inside an ISR, /* If the receive is not processed inside an ISR,
* the softirqd must be woken explicitly to service * the softirqd must be woken explicitly to service
* the NET_RX_SOFTIRQ. In 2.6 kernels, this is handled * the NET_RX_SOFTIRQ. In 2.6 kernels, this is handled
...@@ -782,7 +781,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb, ...@@ -782,7 +781,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
*/ */
netif_rx_ni(skb); netif_rx_ni(skb);
} }
}
} }
void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, bool success) void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, bool success)
...@@ -816,10 +814,9 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net) ...@@ -816,10 +814,9 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
ifp = drvr_priv->iflist[ifidx]; ifp = drvr_priv->iflist[ifidx];
if (drvr_priv->pub.up) { if (drvr_priv->pub.up)
/* Use the protocol to get dongle stats */ /* Use the protocol to get dongle stats */
brcmf_proto_dstats(&drvr_priv->pub); brcmf_proto_dstats(&drvr_priv->pub);
}
/* Copy dongle stats to net device stats */ /* Copy dongle stats to net device stats */
ifp->stats.rx_packets = drvr_priv->pub.dstats.rx_packets; ifp->stats.rx_packets = drvr_priv->pub.dstats.rx_packets;
......
...@@ -1127,11 +1127,10 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok) ...@@ -1127,11 +1127,10 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
#if defined(BCMDBG) #if defined(BCMDBG)
if (bus->alp_only != true) { if (bus->alp_only != true) {
if (SBSDIO_ALPONLY(clkctl)) { if (SBSDIO_ALPONLY(clkctl))
BRCMF_ERROR(("%s: HT Clock should be on.\n", BRCMF_ERROR(("%s: HT Clock should be on.\n",
__func__)); __func__));
} }
}
#endif /* defined (BCMDBG) */ #endif /* defined (BCMDBG) */
bus->activity = true; bus->activity = true;
...@@ -1428,9 +1427,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c ...@@ -1428,9 +1427,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c
} }
/* Some controllers have trouble with odd bytes -- round to even */ /* Some controllers have trouble with odd bytes -- round to even */
if (forcealign && (len & (ALIGNMENT - 1))) { if (forcealign && (len & (ALIGNMENT - 1)))
len = roundup(len, ALIGNMENT); len = roundup(len, ALIGNMENT);
}
do { do {
ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card), ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
...@@ -1782,10 +1780,10 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen) ...@@ -1782,10 +1780,10 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
} }
} }
if (ret == 0) { if (ret == 0)
bus->tx_seq = bus->tx_seq =
(bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP; (bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP;
}
} while ((ret < 0) && retries++ < TXRETRIES); } while ((ret < 0) && retries++ < TXRETRIES);
} }
...@@ -2181,10 +2179,9 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data, ...@@ -2181,10 +2179,9 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
xfer_done: xfer_done:
/* Return the window to backplane enumeration space for core access */ /* Return the window to backplane enumeration space for core access */
if (brcmf_sdbrcm_set_siaddr_window(bus, if (brcmf_sdbrcm_set_siaddr_window(bus,
brcmf_sdcard_cur_sbwad(bus->card))) { brcmf_sdcard_cur_sbwad(bus->card)))
BRCMF_ERROR(("%s: FAILED to set window back to 0x%x\n", BRCMF_ERROR(("%s: FAILED to set window back to 0x%x\n",
__func__, brcmf_sdcard_cur_sbwad(bus->card))); __func__, brcmf_sdcard_cur_sbwad(bus->card)));
}
return bcmerror; return bcmerror;
} }
...@@ -2287,13 +2284,12 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size) ...@@ -2287,13 +2284,12 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
"msgtrace address : 0x%08X\nconsole address : 0x%08X\n", "msgtrace address : 0x%08X\nconsole address : 0x%08X\n",
sdpcm_shared.msgtrace_addr, sdpcm_shared.console_addr); sdpcm_shared.msgtrace_addr, sdpcm_shared.console_addr);
if ((sdpcm_shared.flags & SDPCM_SHARED_ASSERT_BUILT) == 0) { if ((sdpcm_shared.flags & SDPCM_SHARED_ASSERT_BUILT) == 0)
/* NOTE: Misspelled assert is intentional - DO NOT FIX. /* NOTE: Misspelled assert is intentional - DO NOT FIX.
* (Avoids conflict with real asserts for programmatic * (Avoids conflict with real asserts for programmatic
* parsing of output.) * parsing of output.)
*/ */
brcmu_bprintf(&strbuf, "Assrt not built in dongle\n"); brcmu_bprintf(&strbuf, "Assrt not built in dongle\n");
}
if ((sdpcm_shared.flags & (SDPCM_SHARED_ASSERT | SDPCM_SHARED_TRAP)) == if ((sdpcm_shared.flags & (SDPCM_SHARED_ASSERT | SDPCM_SHARED_TRAP)) ==
0) { 0) {
...@@ -2358,10 +2354,10 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size) ...@@ -2358,10 +2354,10 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
BRCMF_ERROR(("%s: %s\n", __func__, strbuf.origbuf)); BRCMF_ERROR(("%s: %s\n", __func__, strbuf.origbuf));
#ifdef BCMDBG #ifdef BCMDBG
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) { if (sdpcm_shared.flags & SDPCM_SHARED_TRAP)
/* Mem dump to a file on device */ /* Mem dump to a file on device */
brcmf_sdbrcm_mem_dump(bus); brcmf_sdbrcm_mem_dump(bus);
}
#endif /* BCMDBG */ #endif /* BCMDBG */
done: done:
...@@ -2591,12 +2587,11 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac ...@@ -2591,12 +2587,11 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
if (bus->drvr->up) { if (bus->drvr->up) {
BRCMF_INTR(("%s: %s SDIO interrupts\n", __func__, BRCMF_INTR(("%s: %s SDIO interrupts\n", __func__,
bus->intr ? "enable" : "disable")); bus->intr ? "enable" : "disable"));
if (bus->intr) { if (bus->intr)
brcmf_sdcard_intr_enable(bus->card); brcmf_sdcard_intr_enable(bus->card);
} else { else
brcmf_sdcard_intr_disable(bus->card); brcmf_sdcard_intr_disable(bus->card);
} }
}
break; break;
case IOV_GVAL(IOV_POLLRATE): case IOV_GVAL(IOV_POLLRATE):
...@@ -3016,10 +3011,10 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus) ...@@ -3016,10 +3011,10 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
varsize, varaddr)); varsize, varaddr));
} }
/* Compare the org NVRAM with the one read from RAM */ /* Compare the org NVRAM with the one read from RAM */
if (memcmp(vbuffer, nvram_ularray, varsize)) { if (memcmp(vbuffer, nvram_ularray, varsize))
BRCMF_ERROR(("%s: Downloaded NVRAM image is " BRCMF_ERROR(("%s: Downloaded NVRAM image is "
"corrupted.\n", __func__)); "corrupted.\n", __func__));
} else else
BRCMF_ERROR(("%s: Download/Upload/Compare of" BRCMF_ERROR(("%s: Download/Upload/Compare of"
" NVRAM ok.\n", __func__)); " NVRAM ok.\n", __func__));
...@@ -3249,10 +3244,9 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex) ...@@ -3249,10 +3244,9 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
SBSDIO_FUNC1_CHIPCLKCSR, SBSDIO_FUNC1_CHIPCLKCSR,
(saveclk | SBSDIO_FORCE_HT), &err); (saveclk | SBSDIO_FORCE_HT), &err);
} }
if (err) { if (err)
BRCMF_ERROR(("%s: Failed to force clock for F2: err %d\n", BRCMF_ERROR(("%s: Failed to force clock for F2: err %d\n",
__func__, err)); __func__, err));
}
/* Turn off the bus (F2), free any pending packets */ /* Turn off the bus (F2), free any pending packets */
BRCMF_INTR(("%s: disable SDIO interrupts\n", __func__)); BRCMF_INTR(("%s: disable SDIO interrupts\n", __func__));
...@@ -3456,13 +3450,12 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx) ...@@ -3456,13 +3450,12 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
lastrbc = (hi << 8) + lo; lastrbc = (hi << 8) + lo;
} }
if (!retries) { if (!retries)
BRCMF_ERROR(("%s: count never zeroed: last 0x%04x\n", BRCMF_ERROR(("%s: count never zeroed: last 0x%04x\n",
__func__, lastrbc)); __func__, lastrbc));
} else { else
BRCMF_INFO(("%s: flush took %d iterations\n", __func__, BRCMF_INFO(("%s: flush took %d iterations\n", __func__,
(0xffff - retries))); (0xffff - retries)));
}
if (rtx) { if (rtx) {
bus->rxrtx++; bus->rxrtx++;
...@@ -3936,11 +3929,11 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) ...@@ -3936,11 +3929,11 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
if (pfirst->len == 0) { if (pfirst->len == 0) {
brcmu_pkt_buf_free_skb(pfirst); brcmu_pkt_buf_free_skb(pfirst);
if (plast) { if (plast)
plast->next = pnext; plast->next = pnext;
} else { else
save_pfirst = pnext; save_pfirst = pnext;
}
continue; continue;
} else if (brcmf_proto_hdrpull(bus->drvr, &ifidx, pfirst) } else if (brcmf_proto_hdrpull(bus->drvr, &ifidx, pfirst)
!= 0) { != 0) {
...@@ -3948,11 +3941,11 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) ...@@ -3948,11 +3941,11 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
__func__)); __func__));
bus->drvr->rx_errors++; bus->drvr->rx_errors++;
brcmu_pkt_buf_free_skb(pfirst); brcmu_pkt_buf_free_skb(pfirst);
if (plast) { if (plast)
plast->next = pnext; plast->next = pnext;
} else { else
save_pfirst = pnext; save_pfirst = pnext;
}
continue; continue;
} }
...@@ -4647,10 +4640,9 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus) ...@@ -4647,10 +4640,9 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
HMB_DATA_NAKHANDLED | HMB_DATA_NAKHANDLED |
HMB_DATA_FC | HMB_DATA_FC |
HMB_DATA_FWREADY | HMB_DATA_FWREADY |
HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK)) { HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK))
BRCMF_ERROR(("Unknown mailbox data content: 0x%02x\n", BRCMF_ERROR(("Unknown mailbox data content: 0x%02x\n",
hmb_data)); hmb_data));
}
return intstatus; return intstatus;
} }
...@@ -5773,13 +5765,13 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card) ...@@ -5773,13 +5765,13 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
default to use if supported */ default to use if supported */
if (brcmf_sdcard_iovar_op(card, "sd_rxchain", NULL, 0, if (brcmf_sdcard_iovar_op(card, "sd_rxchain", NULL, 0,
&bus->sd_rxchain, sizeof(s32), &bus->sd_rxchain, sizeof(s32),
false) != 0) { false) != 0)
bus->sd_rxchain = false; bus->sd_rxchain = false;
} else { else
BRCMF_INFO(("%s: bus module (through sdiocard API) %s" BRCMF_INFO(("%s: bus module (through sdiocard API) %s"
" chaining\n", __func__, bus->sd_rxchain " chaining\n", __func__, bus->sd_rxchain
? "supports" : "does not support")); ? "supports" : "does not support"));
}
bus->use_rxchain = (bool) bus->sd_rxchain; bus->use_rxchain = (bool) bus->sd_rxchain;
return true; return true;
...@@ -5864,9 +5856,8 @@ static void brcmf_sdbrcm_disconnect(void *ptr) ...@@ -5864,9 +5856,8 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
BRCMF_TRACE(("%s: Enter\n", __func__)); BRCMF_TRACE(("%s: Enter\n", __func__));
if (bus) { if (bus)
brcmf_sdbrcm_release(bus); brcmf_sdbrcm_release(bus);
}
BRCMF_TRACE(("%s: Disconnected\n", __func__)); BRCMF_TRACE(("%s: Disconnected\n", __func__));
} }
...@@ -6085,10 +6076,9 @@ static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus) ...@@ -6085,10 +6076,9 @@ static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus)
} }
/* External nvram takes precedence if specified */ /* External nvram takes precedence if specified */
if (brcmf_sdbrcm_download_nvram(bus)) { if (brcmf_sdbrcm_download_nvram(bus))
BRCMF_ERROR(("%s: dongle nvram file download failed\n", BRCMF_ERROR(("%s: dongle nvram file download failed\n",
__func__)); __func__));
}
/* Take arm out of reset */ /* Take arm out of reset */
if (brcmf_sdbrcm_download_state(bus, false)) { if (brcmf_sdbrcm_download_state(bus, false)) {
......
...@@ -677,12 +677,12 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan, ...@@ -677,12 +677,12 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
err = brcmf_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size, err = brcmf_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN); iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
if (unlikely(err)) { if (unlikely(err)) {
if (err == -EBUSY) { if (err == -EBUSY)
WL_INFO("system busy : iscan canceled\n"); WL_INFO("system busy : iscan canceled\n");
} else { else
WL_ERR("error (%d)\n", err); WL_ERR("error (%d)\n", err);
} }
}
kfree(params); kfree(params);
return err; return err;
} }
...@@ -790,12 +790,12 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, ...@@ -790,12 +790,12 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid, err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid,
sizeof(sr->ssid)); sizeof(sr->ssid));
if (err) { if (err) {
if (err == -EBUSY) { if (err == -EBUSY)
WL_INFO("system busy : scan for \"%s\" canceled\n", WL_INFO("system busy : scan for \"%s\" canceled\n",
sr->ssid.SSID); sr->ssid.SSID);
} else { else
WL_ERR("WLC_SCAN error (%d)\n", err); WL_ERR("WLC_SCAN error (%d)\n", err);
}
brcmf_set_mpc(ndev, 1); brcmf_set_mpc(ndev, 1);
goto scan_out; goto scan_out;
} }
...@@ -1049,6 +1049,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1049,6 +1049,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
} else { } else {
memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN); memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
} }
brcmf_update_prof(cfg_priv, NULL, brcmf_update_prof(cfg_priv, NULL,
&join_params.params.bssid, WL_PROF_BSSID); &join_params.params.bssid, WL_PROF_BSSID);
...@@ -1430,10 +1431,9 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1430,10 +1431,9 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN); memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
if (join_params.ssid.SSID_len < IEEE80211_MAX_SSID_LEN) { if (join_params.ssid.SSID_len < IEEE80211_MAX_SSID_LEN)
WL_CONN("ssid \"%s\", len (%d)\n", WL_CONN("ssid \"%s\", len (%d)\n",
join_params.ssid.SSID, join_params.ssid.SSID_len); join_params.ssid.SSID, join_params.ssid.SSID_len);
}
brcmf_ch_to_chanspec(cfg_priv->channel, brcmf_ch_to_chanspec(cfg_priv->channel,
&join_params, &join_params_size); &join_params, &join_params_size);
...@@ -1946,9 +1946,9 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -1946,9 +1946,9 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
scb_val.val = 0; scb_val.val = 0;
err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val, err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
sizeof(struct brcmf_scb_val)); sizeof(struct brcmf_scb_val));
if (unlikely(err)) { if (unlikely(err))
WL_ERR("Could not get rssi (%d)\n", err); WL_ERR("Could not get rssi (%d)\n", err);
}
rssi = le32_to_cpu(scb_val.val); rssi = le32_to_cpu(scb_val.val);
sinfo->filled |= STATION_INFO_SIGNAL; sinfo->filled |= STATION_INFO_SIGNAL;
sinfo->signal = rssi; sinfo->signal = rssi;
...@@ -3523,13 +3523,13 @@ static s32 brcmf_event_handler(void *data) ...@@ -3523,13 +3523,13 @@ static s32 brcmf_event_handler(void *data)
BUG(); BUG();
} }
WL_INFO("event type (%d)\n", e->etype); WL_INFO("event type (%d)\n", e->etype);
if (cfg_priv->el.handler[e->etype]) { if (cfg_priv->el.handler[e->etype])
cfg_priv->el.handler[e->etype](cfg_priv, cfg_priv->el.handler[e->etype](cfg_priv,
cfg_to_ndev(cfg_priv), cfg_to_ndev(cfg_priv),
&e->emsg, e->edata); &e->emsg, e->edata);
} else { else
WL_INFO("Unknown Event (%d): ignoring\n", e->etype); WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
}
brcmf_put_event(e); brcmf_put_event(e);
} }
WL_INFO("was terminated\n"); WL_INFO("was terminated\n");
......
...@@ -387,10 +387,10 @@ get_erom_ent(struct si_pub *sih, u32 **eromptr, u32 mask, u32 match) ...@@ -387,10 +387,10 @@ get_erom_ent(struct si_pub *sih, u32 **eromptr, u32 mask, u32 match)
} }
SI_VMSG(("%s: Returning ent 0x%08x\n", __func__, ent)); SI_VMSG(("%s: Returning ent 0x%08x\n", __func__, ent));
if (inv + nom) { if (inv + nom)
SI_VMSG((" after %d invalid and %d non-matching entries\n", SI_VMSG((" after %d invalid and %d non-matching entries\n",
inv, nom)); inv, nom));
}
return ent; return ent;
} }
...@@ -511,10 +511,9 @@ void ai_scan(struct si_pub *sih, void *regs) ...@@ -511,10 +511,9 @@ void ai_scan(struct si_pub *sih, void *regs)
if (cid == OOB_ROUTER_CORE_ID) { if (cid == OOB_ROUTER_CORE_ID) {
asd = get_asd(sih, &eromptr, 0, 0, AD_ST_SLAVE, asd = get_asd(sih, &eromptr, 0, 0, AD_ST_SLAVE,
&addrl, &addrh, &sizel, &sizeh); &addrl, &addrh, &sizel, &sizeh);
if (asd != 0) { if (asd != 0)
sii->oob_router = addrl; sii->oob_router = addrl;
} }
}
continue; continue;
} }
...@@ -650,13 +649,13 @@ void *ai_setcoreidx(struct si_pub *sih, uint coreidx) ...@@ -650,13 +649,13 @@ void *ai_setcoreidx(struct si_pub *sih, uint coreidx)
switch (sih->bustype) { switch (sih->bustype) {
case SI_BUS: case SI_BUS:
/* map new one */ /* map new one */
if (!sii->regs[coreidx]) { if (!sii->regs[coreidx])
sii->regs[coreidx] = REG_MAP(addr, SI_CORE_SIZE); sii->regs[coreidx] = REG_MAP(addr, SI_CORE_SIZE);
}
sii->curmap = regs = sii->regs[coreidx]; sii->curmap = regs = sii->regs[coreidx];
if (!sii->wrappers[coreidx]) { if (!sii->wrappers[coreidx])
sii->wrappers[coreidx] = REG_MAP(wrap, SI_CORE_SIZE); sii->wrappers[coreidx] = REG_MAP(wrap, SI_CORE_SIZE);
}
sii->curwrap = sii->wrappers[coreidx]; sii->curwrap = sii->wrappers[coreidx];
break; break;
...@@ -1063,9 +1062,8 @@ static __used void ai_nvram_process(struct si_info *sii, char *pvars) ...@@ -1063,9 +1062,8 @@ static __used void ai_nvram_process(struct si_info *sii, char *pvars)
break; break;
} }
if (sii->pub.boardtype == 0) { if (sii->pub.boardtype == 0)
SI_ERROR(("si_doattach: unknown board type\n")); SI_ERROR(("si_doattach: unknown board type\n"));
}
sii->pub.boardflags = getintvar(pvars, "boardflags"); sii->pub.boardflags = getintvar(pvars, "boardflags");
} }
...@@ -1195,9 +1193,8 @@ static struct si_info *ai_doattach(struct si_info *sii, ...@@ -1195,9 +1193,8 @@ static struct si_info *ai_doattach(struct si_info *sii,
ai_corereg(sih, SI_CC_IDX, offsetof(struct chipcregs, gpiotimerval), ai_corereg(sih, SI_CC_IDX, offsetof(struct chipcregs, gpiotimerval),
~0, w); ~0, w);
if (PCIE(sii)) { if (PCIE(sii))
pcicore_attach(sii->pch, pvars, SI_DOATTACH); pcicore_attach(sii->pch, pvars, SI_DOATTACH);
}
if (sih->chip == BCM43224_CHIP_ID) { if (sih->chip == BCM43224_CHIP_ID) {
/* /*
...@@ -1435,10 +1432,10 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask, ...@@ -1435,10 +1432,10 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,
/* If internal bus, we can always get at everything */ /* If internal bus, we can always get at everything */
fast = true; fast = true;
/* map if does not exist */ /* map if does not exist */
if (!sii->regs[coreidx]) { if (!sii->regs[coreidx])
sii->regs[coreidx] = REG_MAP(sii->coresba[coreidx], sii->regs[coreidx] = REG_MAP(sii->coresba[coreidx],
SI_CORE_SIZE); SI_CORE_SIZE);
}
r = (u32 *) ((unsigned char *) sii->regs[coreidx] + regoff); r = (u32 *) ((unsigned char *) sii->regs[coreidx] + regoff);
} else if (sih->bustype == PCI_BUS) { } else if (sih->bustype == PCI_BUS) {
/* /*
...@@ -2187,16 +2184,15 @@ void ai_chipcontrl_epa4331(struct si_pub *sih, bool on) ...@@ -2187,16 +2184,15 @@ void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
val = R_REG(&cc->chipcontrol); val = R_REG(&cc->chipcontrol);
if (on) { if (on) {
if (sih->chippkg == 9 || sih->chippkg == 0xb) { if (sih->chippkg == 9 || sih->chippkg == 0xb)
/* Ext PA Controls for 4331 12x9 Package */ /* Ext PA Controls for 4331 12x9 Package */
W_REG(&cc->chipcontrol, val | W_REG(&cc->chipcontrol, val |
(CCTRL4331_EXTPA_EN | (CCTRL4331_EXTPA_EN |
CCTRL4331_EXTPA_ON_GPIO2_5)); CCTRL4331_EXTPA_ON_GPIO2_5));
} else { else
/* Ext PA Controls for 4331 12x12 Package */ /* Ext PA Controls for 4331 12x12 Package */
W_REG(&cc->chipcontrol, W_REG(&cc->chipcontrol,
val | (CCTRL4331_EXTPA_EN)); val | (CCTRL4331_EXTPA_EN));
}
} else { } else {
val &= ~(CCTRL4331_EXTPA_EN | CCTRL4331_EXTPA_ON_GPIO2_5); val &= ~(CCTRL4331_EXTPA_EN | CCTRL4331_EXTPA_ON_GPIO2_5);
W_REG(&cc->chipcontrol, val); W_REG(&cc->chipcontrol, val);
......
...@@ -161,12 +161,11 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid) ...@@ -161,12 +161,11 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
} else { } else {
int i; int i;
for (i = 1; i < MAXBANDS; i++) { for (i = 1; i < MAXBANDS; i++)
wlc->hw->bandstate[i] = (struct brcms_hw_band *) wlc->hw->bandstate[i] = (struct brcms_hw_band *)
((unsigned long)wlc->hw->bandstate[0] + ((unsigned long)wlc->hw->bandstate[0] +
(sizeof(struct brcms_hw_band) * i)); (sizeof(struct brcms_hw_band) * i));
} }
}
wlc->modulecb = wlc->modulecb =
kzalloc(sizeof(struct modulecb) * BRCMS_MAXMODULES, GFP_ATOMIC); kzalloc(sizeof(struct modulecb) * BRCMS_MAXMODULES, GFP_ATOMIC);
...@@ -196,12 +195,11 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid) ...@@ -196,12 +195,11 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
goto fail; goto fail;
} else { } else {
int i; int i;
for (i = 1; i < BRCMS_DEFAULT_KEYS; i++) { for (i = 1; i < BRCMS_DEFAULT_KEYS; i++)
wlc->wsec_def_keys[i] = (struct wsec_key *) wlc->wsec_def_keys[i] = (struct wsec_key *)
((unsigned long)wlc->wsec_def_keys[0] + ((unsigned long)wlc->wsec_def_keys[0] +
(sizeof(struct wsec_key) * i)); (sizeof(struct wsec_key) * i));
} }
}
wlc->protection = kzalloc(sizeof(struct brcms_protection), wlc->protection = kzalloc(sizeof(struct brcms_protection),
GFP_ATOMIC); GFP_ATOMIC);
...@@ -224,12 +222,11 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid) ...@@ -224,12 +222,11 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
} else { } else {
int i; int i;
for (i = 1; i < MAXBANDS; i++) { for (i = 1; i < MAXBANDS; i++)
wlc->bandstate[i] = (struct brcms_band *) wlc->bandstate[i] = (struct brcms_band *)
((unsigned long)wlc->bandstate[0] ((unsigned long)wlc->bandstate[0]
+ (sizeof(struct brcms_band)*i)); + (sizeof(struct brcms_band)*i));
} }
}
wlc->corestate = kzalloc(sizeof(struct brcms_core), GFP_ATOMIC); wlc->corestate = kzalloc(sizeof(struct brcms_core), GFP_ATOMIC);
if (wlc->corestate == NULL) { if (wlc->corestate == NULL) {
......
...@@ -195,9 +195,8 @@ void brcms_c_ampdu_detach(struct ampdu_info *ampdu) ...@@ -195,9 +195,8 @@ void brcms_c_ampdu_detach(struct ampdu_info *ampdu)
return; return;
/* free all ini's which were to be freed on callbacks which were never called */ /* free all ini's which were to be freed on callbacks which were never called */
for (i = 0; i < AMPDU_INI_FREE; i++) { for (i = 0; i < AMPDU_INI_FREE; i++)
kfree(ampdu->ini_free[i]); kfree(ampdu->ini_free[i]);
}
brcms_c_module_unregister(ampdu->wlc->pub, "ampdu", ampdu); brcms_c_module_unregister(ampdu->wlc->pub, "ampdu", ampdu);
kfree(ampdu); kfree(ampdu);
...@@ -317,9 +316,9 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid) ...@@ -317,9 +316,9 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
txunfl_ratio = current_ampdu_cnt / fifo->accum_txfunfl; txunfl_ratio = current_ampdu_cnt / fifo->accum_txfunfl;
if (txunfl_ratio > ampdu->tx_max_funl) { if (txunfl_ratio > ampdu->tx_max_funl) {
if (current_ampdu_cnt >= FFPLD_MAX_AMPDU_CNT) { if (current_ampdu_cnt >= FFPLD_MAX_AMPDU_CNT)
fifo->accum_txfunfl = 0; fifo->accum_txfunfl = 0;
}
return 0; return 0;
} }
max_mpdu = max_mpdu =
...@@ -486,10 +485,9 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi, ...@@ -486,10 +485,9 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
/* Let pressure continue to build ... */ /* Let pressure continue to build ... */
qlen = pktq_plen(&qi->q, prec); qlen = pktq_plen(&qi->q, prec);
if (ini->tx_in_transit > 0 && if (ini->tx_in_transit > 0 &&
qlen < min(scb_ampdu->max_pdu, ini->ba_wsize)) { qlen < min(scb_ampdu->max_pdu, ini->ba_wsize))
/* Collect multiple MPDU's to be sent in the next AMPDU */ /* Collect multiple MPDU's to be sent in the next AMPDU */
return -EBUSY; return -EBUSY;
}
/* at this point we intend to transmit an AMPDU */ /* at this point we intend to transmit an AMPDU */
rr_retry_limit = ampdu->rr_retry_limit_tid[tid]; rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
...@@ -665,9 +663,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi, ...@@ -665,9 +663,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
break; break;
} }
if (count == scb_ampdu->max_pdu) { if (count == scb_ampdu->max_pdu)
break; break;
}
/* check to see if the next pkt is a candidate for aggregation */ /* check to see if the next pkt is a candidate for aggregation */
p = pktq_ppeek(&qi->q, prec); p = pktq_ppeek(&qi->q, prec);
...@@ -797,10 +794,10 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi, ...@@ -797,10 +794,10 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
/* inform rate_sel if it this is a rate probe pkt */ /* inform rate_sel if it this is a rate probe pkt */
frameid = le16_to_cpu(txh->TxFrameID); frameid = le16_to_cpu(txh->TxFrameID);
if (frameid & TXFID_RATE_PROBE_MASK) { if (frameid & TXFID_RATE_PROBE_MASK)
wiphy_err(wiphy, "%s: XXX what to do with " wiphy_err(wiphy, "%s: XXX what to do with "
"TXFID_RATE_PROBE_MASK!?\n", __func__); "TXFID_RATE_PROBE_MASK!?\n", __func__);
}
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
brcms_c_txfifo(wlc, fifo, pkt[i], i == (count - 1), brcms_c_txfifo(wlc, fifo, pkt[i], i == (count - 1),
ampdu->txpkt_weight); ampdu->txpkt_weight);
...@@ -833,10 +830,9 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb, ...@@ -833,10 +830,9 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
while (((s1 = R_REG(&wlc->regs->frmtxstatus)) & TXS_V) == 0) { while (((s1 = R_REG(&wlc->regs->frmtxstatus)) & TXS_V) == 0) {
udelay(1); udelay(1);
status_delay++; status_delay++;
if (status_delay > 10) { if (status_delay > 10)
return; /* error condition */ return; /* error condition */
} }
}
s2 = R_REG(&wlc->regs->frmtxstatus2); s2 = R_REG(&wlc->regs->frmtxstatus2);
} }
...@@ -923,9 +919,8 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, ...@@ -923,9 +919,8 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
supr_status = txs->status & TX_STATUS_SUPR_MASK; supr_status = txs->status & TX_STATUS_SUPR_MASK;
if (txs->status & TX_STATUS_ACK_RCV) { if (txs->status & TX_STATUS_ACK_RCV) {
if (TX_STATUS_SUPR_UF == supr_status) { if (TX_STATUS_SUPR_UF == supr_status)
update_rate = false; update_rate = false;
}
WARN_ON(!(txs->status & TX_STATUS_INTERMEDIATE)); WARN_ON(!(txs->status & TX_STATUS_INTERMEDIATE));
start_seq = txs->sequence >> SEQNUM_SHIFT; start_seq = txs->sequence >> SEQNUM_SHIFT;
...@@ -973,10 +968,9 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, ...@@ -973,10 +968,9 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
notify rate adaptation. notify rate adaptation.
*/ */
if (brcms_c_ffpld_check_txfunfl(wlc, if (brcms_c_ffpld_check_txfunfl(wlc,
prio2fifo[tid]) > 0) { prio2fifo[tid]) > 0)
tx_error = true; tx_error = true;
} }
}
} else if (txs->phyerr) { } else if (txs->phyerr) {
update_rate = false; update_rate = false;
wiphy_err(wiphy, "wl%d: ampdu tx phy " wiphy_err(wiphy, "wl%d: ampdu tx phy "
...@@ -1211,9 +1205,8 @@ void brcms_c_ampdu_flush(struct brcms_c_info *wlc, ...@@ -1211,9 +1205,8 @@ void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
ampdu_pars.sta = sta; ampdu_pars.sta = sta;
ampdu_pars.tid = tid; ampdu_pars.tid = tid;
for (prec = 0; prec < pq->num_prec; prec++) { for (prec = 0; prec < pq->num_prec; prec++)
brcmu_pktq_pflush(pq, prec, true, cb_del_ampdu_pkt, brcmu_pktq_pflush(pq, prec, true, cb_del_ampdu_pkt,
(void *)&ampdu_pars); (void *)&ampdu_pars);
}
brcms_c_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu); brcms_c_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu);
} }
...@@ -110,17 +110,16 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc) ...@@ -110,17 +110,16 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc)
if (((u16) getintvar(asi->pub->vars, "aa2g") == 7) || if (((u16) getintvar(asi->pub->vars, "aa2g") == 7) ||
((u16) getintvar(asi->pub->vars, "aa5g") == 7)) { ((u16) getintvar(asi->pub->vars, "aa5g") == 7)) {
asi->antsel_avail = true; asi->antsel_avail = true;
} else } else if (
if (((u16) getintvar(asi->pub->vars, "aa2g") == (u16) getintvar(asi->pub->vars, "aa2g") == 3 ||
3) (u16) getintvar(asi->pub->vars, "aa5g") == 3) {
|| ((u16) getintvar(asi->pub->vars, "aa5g")
== 3)) {
asi->antsel_avail = false; asi->antsel_avail = false;
} else { } else {
asi->antsel_avail = false; asi->antsel_avail = false;
wiphy_err(wlc->wiphy, "antsel_attach: 2o3 " wiphy_err(wlc->wiphy, "antsel_attach: 2o3 "
"board cfg invalid\n"); "board cfg invalid\n");
} }
break; break;
default: default:
break; break;
......
...@@ -533,12 +533,12 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih, ...@@ -533,12 +533,12 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
di->aligndesc_4k = _dma_descriptor_align(di); di->aligndesc_4k = _dma_descriptor_align(di);
if (di->aligndesc_4k) { if (di->aligndesc_4k) {
di->dmadesc_align = D64RINGALIGN_BITS; di->dmadesc_align = D64RINGALIGN_BITS;
if ((ntxd < D64MAXDD / 2) && (nrxd < D64MAXDD / 2)) { if ((ntxd < D64MAXDD / 2) && (nrxd < D64MAXDD / 2))
/* for smaller dd table, HW relax alignment reqmnt */ /* for smaller dd table, HW relax alignment reqmnt */
di->dmadesc_align = D64RINGALIGN_BITS - 1; di->dmadesc_align = D64RINGALIGN_BITS - 1;
} } else {
} else
di->dmadesc_align = 4; /* 16 byte alignment */ di->dmadesc_align = 4; /* 16 byte alignment */
}
DMA_NONE(("DMA descriptor align_needed %d, align %d\n", DMA_NONE(("DMA descriptor align_needed %d, align %d\n",
di->aligndesc_4k, di->dmadesc_align)); di->aligndesc_4k, di->dmadesc_align));
...@@ -662,11 +662,10 @@ dma64_dd_upd(struct dma_info *di, struct dma64desc *ddring, ...@@ -662,11 +662,10 @@ dma64_dd_upd(struct dma_info *di, struct dma64desc *ddring,
W_SM(&ddring[outidx].ctrl2, BUS_SWAP32(ctrl2)); W_SM(&ddring[outidx].ctrl2, BUS_SWAP32(ctrl2));
} }
if (di->dma.dmactrlflags & DMA_CTRL_PEN) { if (di->dma.dmactrlflags & DMA_CTRL_PEN) {
if (DMA64_DD_PARITY(&ddring[outidx])) { if (DMA64_DD_PARITY(&ddring[outidx]))
W_SM(&ddring[outidx].ctrl2, W_SM(&ddring[outidx].ctrl2,
BUS_SWAP32(ctrl2 | D64_CTRL2_PARITY)); BUS_SWAP32(ctrl2 | D64_CTRL2_PARITY));
} }
}
} }
static bool _dma_alloc(struct dma_info *di, uint direction) static bool _dma_alloc(struct dma_info *di, uint direction)
...@@ -743,18 +742,17 @@ static bool _dma_isaddrext(struct dma_info *di) ...@@ -743,18 +742,17 @@ static bool _dma_isaddrext(struct dma_info *di)
/* not all tx or rx channel are available */ /* not all tx or rx channel are available */
if (di->d64txregs != NULL) { if (di->d64txregs != NULL) {
if (!_dma64_addrext(di->d64txregs)) { if (!_dma64_addrext(di->d64txregs))
DMA_ERROR(("%s: _dma_isaddrext: DMA64 tx doesn't have " DMA_ERROR(("%s: _dma_isaddrext: DMA64 tx doesn't have "
"AE set\n", di->name)); "AE set\n", di->name));
}
return true; return true;
} else if (di->d64rxregs != NULL) { } else if (di->d64rxregs != NULL) {
if (!_dma64_addrext(di->d64rxregs)) { if (!_dma64_addrext(di->d64rxregs))
DMA_ERROR(("%s: _dma_isaddrext: DMA64 rx doesn't have " DMA_ERROR(("%s: _dma_isaddrext: DMA64 rx doesn't have "
"AE set\n", di->name)); "AE set\n", di->name));
}
return true; return true;
} }
return false; return false;
} }
...@@ -1157,17 +1155,16 @@ static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags) ...@@ -1157,17 +1155,16 @@ static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags)
control = R_REG(&di->d64txregs->control); control = R_REG(&di->d64txregs->control);
W_REG(&di->d64txregs->control, W_REG(&di->d64txregs->control,
control | D64_XC_PD); control | D64_XC_PD);
if (R_REG(&di->d64txregs->control) & D64_XC_PD) { if (R_REG(&di->d64txregs->control) & D64_XC_PD)
/* We *can* disable it so it is supported, /* We *can* disable it so it is supported,
* restore control register * restore control register
*/ */
W_REG(&di->d64txregs->control, W_REG(&di->d64txregs->control,
control); control);
} else { else
/* Not supported, don't allow it to be enabled */ /* Not supported, don't allow it to be enabled */
dmactrlflags &= ~DMA_CTRL_PEN; dmactrlflags &= ~DMA_CTRL_PEN;
} }
}
di->dma.dmactrlflags = dmactrlflags; di->dma.dmactrlflags = dmactrlflags;
...@@ -1186,9 +1183,8 @@ static ...@@ -1186,9 +1183,8 @@ static
u8 dma_align_sizetobits(uint size) u8 dma_align_sizetobits(uint size)
{ {
u8 bitpos = 0; u8 bitpos = 0;
while (size >>= 1) { while (size >>= 1)
bitpos++; bitpos++;
}
return bitpos; return bitpos;
} }
...@@ -1521,10 +1517,9 @@ dma64_txunframed(struct dma_info *di, void *buf, uint len, bool commit) ...@@ -1521,10 +1517,9 @@ dma64_txunframed(struct dma_info *di, void *buf, uint len, bool commit)
di->txout = txout; di->txout = txout;
/* kick the chip */ /* kick the chip */
if (commit) { if (commit)
W_REG(&di->d64txregs->ptr, W_REG(&di->d64txregs->ptr,
di->xmtptrbase + I2B(txout, struct dma64desc)); di->xmtptrbase + I2B(txout, struct dma64desc));
}
/* tx flow control */ /* tx flow control */
di->dma.txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1; di->dma.txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
......
...@@ -217,10 +217,10 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -217,10 +217,10 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
err = brcms_up(wl); err = brcms_up(wl);
UNLOCK(wl); UNLOCK(wl);
if (err != 0) { if (err != 0)
wiphy_err(hw->wiphy, "%s: brcms_up() returned %d\n", __func__, wiphy_err(hw->wiphy, "%s: brcms_up() returned %d\n", __func__,
err); err);
}
return err; return err;
} }
...@@ -307,9 +307,9 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed) ...@@ -307,9 +307,9 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
"\n", __func__, conf->power_level * 4, "\n", __func__, conf->power_level * 4,
new_int); new_int);
} }
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
err = ieee_set_channel(hw, conf->channel, conf->channel_type); err = ieee_set_channel(hw, conf->channel, conf->channel_type);
}
if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) { if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
if (brcms_c_set if (brcms_c_set
(wl->wlc, BRCM_SET_SRL, (wl->wlc, BRCM_SET_SRL,
...@@ -420,32 +420,36 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw, ...@@ -420,32 +420,36 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
info->bssid); info->bssid);
UNLOCK(wl); UNLOCK(wl);
} }
if (changed & BSS_CHANGED_BEACON) { if (changed & BSS_CHANGED_BEACON)
/* Beacon data changed, retrieve new beacon (beaconing modes) */ /* Beacon data changed, retrieve new beacon (beaconing modes) */
wiphy_err(wiphy, "%s: beacon changed\n", __func__); wiphy_err(wiphy, "%s: beacon changed\n", __func__);
}
if (changed & BSS_CHANGED_BEACON_ENABLED) { if (changed & BSS_CHANGED_BEACON_ENABLED) {
/* Beaconing should be enabled/disabled (beaconing modes) */ /* Beaconing should be enabled/disabled (beaconing modes) */
wiphy_err(wiphy, "%s: Beacon enabled: %s\n", __func__, wiphy_err(wiphy, "%s: Beacon enabled: %s\n", __func__,
info->enable_beacon ? "true" : "false"); info->enable_beacon ? "true" : "false");
} }
if (changed & BSS_CHANGED_CQM) { if (changed & BSS_CHANGED_CQM) {
/* Connection quality monitor config changed */ /* Connection quality monitor config changed */
wiphy_err(wiphy, "%s: cqm change: threshold %d, hys %d " wiphy_err(wiphy, "%s: cqm change: threshold %d, hys %d "
" (implement)\n", __func__, info->cqm_rssi_thold, " (implement)\n", __func__, info->cqm_rssi_thold,
info->cqm_rssi_hyst); info->cqm_rssi_hyst);
} }
if (changed & BSS_CHANGED_IBSS) { if (changed & BSS_CHANGED_IBSS) {
/* IBSS join status changed */ /* IBSS join status changed */
wiphy_err(wiphy, "%s: IBSS joined: %s (implement)\n", __func__, wiphy_err(wiphy, "%s: IBSS joined: %s (implement)\n", __func__,
info->ibss_joined ? "true" : "false"); info->ibss_joined ? "true" : "false");
} }
if (changed & BSS_CHANGED_ARP_FILTER) { if (changed & BSS_CHANGED_ARP_FILTER) {
/* Hardware ARP filter address list or state changed */ /* Hardware ARP filter address list or state changed */
wiphy_err(wiphy, "%s: arp filtering: enabled %s, count %d" wiphy_err(wiphy, "%s: arp filtering: enabled %s, count %d"
" (implement)\n", __func__, info->arp_filter_enabled ? " (implement)\n", __func__, info->arp_filter_enabled ?
"true" : "false", info->arp_addr_cnt); "true" : "false", info->arp_addr_cnt);
} }
if (changed & BSS_CHANGED_QOS) { if (changed & BSS_CHANGED_QOS) {
/* /*
* QoS for this association was enabled/disabled. * QoS for this association was enabled/disabled.
...@@ -757,9 +761,8 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device, ...@@ -757,9 +761,8 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
unit = n_adapters_found; unit = n_adapters_found;
err = 0; err = 0;
if (unit < 0) { if (unit < 0)
return NULL; return NULL;
}
/* allocate private info */ /* allocate private info */
hw = pci_get_drvdata(btparam); /* btparam == pdev */ hw = pci_get_drvdata(btparam); /* btparam == pdev */
...@@ -816,10 +819,9 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device, ...@@ -816,10 +819,9 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
wl->pub->ieee_hw = hw; wl->pub->ieee_hw = hw;
if (brcms_c_set_par(wl->wlc, IOV_MPC, 0) < 0) { if (brcms_c_set_par(wl->wlc, IOV_MPC, 0) < 0)
wiphy_err(wl->wiphy, "wl%d: Error setting MPC variable to 0\n", wiphy_err(wl->wiphy, "wl%d: Error setting MPC variable to 0\n",
unit); unit);
}
/* register our interrupt handler */ /* register our interrupt handler */
if (request_irq(irq, brcms_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) { if (request_irq(irq, brcms_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) {
...@@ -843,19 +845,17 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device, ...@@ -843,19 +845,17 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
SET_IEEE80211_PERM_ADDR(hw, perm); SET_IEEE80211_PERM_ADDR(hw, perm);
err = ieee80211_register_hw(hw); err = ieee80211_register_hw(hw);
if (err) { if (err)
wiphy_err(wl->wiphy, "%s: ieee80211_register_hw failed, status" wiphy_err(wl->wiphy, "%s: ieee80211_register_hw failed, status"
"%d\n", __func__, err); "%d\n", __func__, err);
}
if (wl->pub->srom_ccode[0]) if (wl->pub->srom_ccode[0])
err = brcms_set_hint(wl, wl->pub->srom_ccode); err = brcms_set_hint(wl, wl->pub->srom_ccode);
else else
err = brcms_set_hint(wl, "US"); err = brcms_set_hint(wl, "US");
if (err) { if (err)
wiphy_err(wl->wiphy, "%s: regulatory_hint failed, status %d\n", wiphy_err(wl->wiphy, "%s: regulatory_hint failed, status %d\n",
__func__, err); __func__, err);
}
n_adapters_found++; n_adapters_found++;
return wl; return wl;
...@@ -1064,13 +1064,12 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw) ...@@ -1064,13 +1064,12 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
/* Assume all bands use the same phy. True for 11n devices. */ /* Assume all bands use the same phy. True for 11n devices. */
if (NBANDS_PUB(wl->pub) > 1) { if (NBANDS_PUB(wl->pub) > 1) {
has_5g++; has_5g++;
if (phy_list[0] == 'n' || phy_list[0] == 'c') { if (phy_list[0] == 'n' || phy_list[0] == 'c')
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
&brcms_band_5GHz_nphy; &brcms_band_5GHz_nphy;
} else { else
return -EPERM; return -EPERM;
} }
}
return 0; return 0;
} }
...@@ -1337,9 +1336,8 @@ static void brcms_free(struct brcms_info *wl) ...@@ -1337,9 +1336,8 @@ static void brcms_free(struct brcms_info *wl)
/* kill dpc */ /* kill dpc */
tasklet_kill(&wl->tasklet); tasklet_kill(&wl->tasklet);
if (wl->pub) { if (wl->pub)
brcms_c_module_unregister(wl->pub, "linux", wl); brcms_c_module_unregister(wl->pub, "linux", wl);
}
/* free common resources */ /* free common resources */
if (wl->wlc) { if (wl->wlc) {
...@@ -1368,9 +1366,9 @@ static void brcms_free(struct brcms_info *wl) ...@@ -1368,9 +1366,9 @@ static void brcms_free(struct brcms_info *wl)
* so we cannot unmap the chip registers until after calling unregister_netdev() . * so we cannot unmap the chip registers until after calling unregister_netdev() .
*/ */
if (wl->regsva && wl->bcm_bustype != SDIO_BUS && if (wl->regsva && wl->bcm_bustype != SDIO_BUS &&
wl->bcm_bustype != JTAG_BUS) { wl->bcm_bustype != JTAG_BUS)
iounmap((void *)wl->regsva); iounmap((void *)wl->regsva);
}
wl->regsva = NULL; wl->regsva = NULL;
} }
...@@ -1558,10 +1556,9 @@ static void brcms_dpc(unsigned long data) ...@@ -1558,10 +1556,9 @@ static void brcms_dpc(unsigned long data)
/* re-schedule dpc */ /* re-schedule dpc */
if (wl->resched) if (wl->resched)
tasklet_schedule(&wl->tasklet); tasklet_schedule(&wl->tasklet);
else { else
/* re-enable interrupts */ /* re-enable interrupts */
brcms_intrson(wl); brcms_intrson(wl);
}
done: done:
UNLOCK(wl); UNLOCK(wl);
...@@ -1645,10 +1642,10 @@ void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *t, uint ms, ...@@ -1645,10 +1642,10 @@ void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *t, uint ms,
int periodic) int periodic)
{ {
#ifdef BCMDBG #ifdef BCMDBG
if (t->set) { if (t->set)
wiphy_err(wl->wiphy, "%s: Already set. Name: %s, per %d\n", wiphy_err(wl->wiphy, "%s: Already set. Name: %s, per %d\n",
__func__, t->name, periodic); __func__, t->name, periodic);
}
#endif #endif
t->ms = ms; t->ms = ms;
t->periodic = (bool) periodic; t->periodic = (bool) periodic;
...@@ -1668,9 +1665,9 @@ bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *t) ...@@ -1668,9 +1665,9 @@ bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *t)
{ {
if (t->set) { if (t->set) {
t->set = false; t->set = false;
if (!del_timer(&t->timer)) { if (!del_timer(&t->timer))
return false; return false;
}
atomic_dec(&wl->callbacks); atomic_dec(&wl->callbacks);
} }
......
This diff is collapsed.
...@@ -399,6 +399,7 @@ static bool pcie_mdiosetblock(struct pcicore_info *pi, uint blk) ...@@ -399,6 +399,7 @@ static bool pcie_mdiosetblock(struct pcicore_info *pi, uint blk)
while (i < pcie_serdes_spinwait) { while (i < pcie_serdes_spinwait) {
if (R_REG(&pcieregs->mdiocontrol) & MDIOCTL_ACCESS_DONE) if (R_REG(&pcieregs->mdiocontrol) & MDIOCTL_ACCESS_DONE)
break; break;
udelay(1000); udelay(1000);
i++; i++;
} }
...@@ -823,6 +824,7 @@ void pcicore_fixcfg(void *pch, void *regs) ...@@ -823,6 +824,7 @@ void pcicore_fixcfg(void *pch, void *regs)
reg16 = &pcieregs->sprom[SRSH_PI_OFFSET]; reg16 = &pcieregs->sprom[SRSH_PI_OFFSET];
else if (sii->pub.buscoretype == PCI_CORE_ID) else if (sii->pub.buscoretype == PCI_CORE_ID)
reg16 = &pciregs->sprom[SRSH_PI_OFFSET]; reg16 = &pciregs->sprom[SRSH_PI_OFFSET];
pciidx = ai_coreidx(&sii->pub); pciidx = ai_coreidx(&sii->pub);
val16 = R_REG(reg16); val16 = R_REG(reg16);
if (((val16 & SRSH_PI_MASK) >> SRSH_PI_SHIFT) != (u16)pciidx) { if (((val16 & SRSH_PI_MASK) >> SRSH_PI_SHIFT) != (u16)pciidx) {
......
...@@ -184,12 +184,12 @@ static u16 ipxotp_read_bit(void *oh, struct chipcregs *cc, uint off) ...@@ -184,12 +184,12 @@ static u16 ipxotp_read_bit(void *oh, struct chipcregs *cc, uint off)
((st = R_REG(&cc->otpprog)) & OTPP_START_BUSY) ((st = R_REG(&cc->otpprog)) & OTPP_START_BUSY)
&& (k < OTPP_TRIES); k++) && (k < OTPP_TRIES); k++)
; ;
if (k >= OTPP_TRIES) { if (k >= OTPP_TRIES)
return 0xffff; return 0xffff;
}
if (st & OTPP_READERR) { if (st & OTPP_READERR)
return 0xffff; return 0xffff;
}
st = (st & OTPP_VALUE_MASK) >> OTPP_VALUE_SHIFT; st = (st & OTPP_VALUE_MASK) >> OTPP_VALUE_SHIFT;
return (int)st; return (int)st;
...@@ -245,9 +245,8 @@ static void _ipxotp_init(struct otpinfo *oi, struct chipcregs *cc) ...@@ -245,9 +245,8 @@ static void _ipxotp_init(struct otpinfo *oi, struct chipcregs *cc)
((st = R_REG(&cc->otpprog)) & OTPP_START_BUSY) ((st = R_REG(&cc->otpprog)) & OTPP_START_BUSY)
&& (k < OTPP_TRIES); k++) && (k < OTPP_TRIES); k++)
; ;
if (k >= OTPP_TRIES) { if (k >= OTPP_TRIES)
return; return;
}
/* Read OTP lock bits and subregion programmed indication bits */ /* Read OTP lock bits and subregion programmed indication bits */
oi->status = R_REG(&cc->otpstatus); oi->status = R_REG(&cc->otpstatus);
...@@ -493,9 +492,8 @@ void *otp_init(struct si_pub *sih) ...@@ -493,9 +492,8 @@ void *otp_init(struct si_pub *sih)
if (OTPTYPE_IPX(oi->ccrev)) if (OTPTYPE_IPX(oi->ccrev))
oi->fn = &ipxotp_fn; oi->fn = &ipxotp_fn;
if (oi->fn == NULL) { if (oi->fn == NULL)
return NULL; return NULL;
}
oi->sih = sih; oi->sih = sih;
......
...@@ -246,7 +246,7 @@ enum phy_cal_mode { ...@@ -246,7 +246,7 @@ enum phy_cal_mode {
#define MOD_PHY_REG(pi, phy_type, reg_name, field, value) \ #define MOD_PHY_REG(pi, phy_type, reg_name, field, value) \
mod_phy_reg(pi, phy_type##_##reg_name, phy_type##_##reg_name##_##field##_MASK, \ mod_phy_reg(pi, phy_type##_##reg_name, phy_type##_##reg_name##_##field##_MASK, \
(value) << phy_type##_##reg_name##_##field##_##SHIFT); (value) << phy_type##_##reg_name##_##field##_##SHIFT)
#define READ_PHY_REG(pi, phy_type, reg_name, field) \ #define READ_PHY_REG(pi, phy_type, reg_name, field) \
((read_phy_reg(pi, phy_type##_##reg_name) & phy_type##_##reg_name##_##field##_##MASK)\ ((read_phy_reg(pi, phy_type##_##reg_name) & phy_type##_##reg_name##_##field##_##MASK)\
>> phy_type##_##reg_name##_##field##_##SHIFT) >> phy_type##_##reg_name##_##field##_##SHIFT)
......
...@@ -35,11 +35,11 @@ When both the 16bit inputs are 0x8000 then the output is saturated to 0x7fffffff ...@@ -35,11 +35,11 @@ When both the 16bit inputs are 0x8000 then the output is saturated to 0x7fffffff
s16 qm_muls16(s16 op1, s16 op2) s16 qm_muls16(s16 op1, s16 op2)
{ {
s32 result; s32 result;
if (op1 == (s16) 0x8000 && op2 == (s16) 0x8000) { if (op1 == (s16) 0x8000 && op2 == (s16) 0x8000)
result = 0x7fffffff; result = 0x7fffffff;
} else { else
result = ((s32) (op1) * (s32) (op2)); result = ((s32) (op1) * (s32) (op2));
}
return (s16) (result >> 15); return (s16) (result >> 15);
} }
...@@ -51,11 +51,11 @@ s32 qm_add32(s32 op1, s32 op2) ...@@ -51,11 +51,11 @@ s32 qm_add32(s32 op1, s32 op2)
{ {
s32 result; s32 result;
result = op1 + op2; result = op1 + op2;
if (op1 < 0 && op2 < 0 && result > 0) { if (op1 < 0 && op2 < 0 && result > 0)
result = 0x80000000; result = 0x80000000;
} else if (op1 > 0 && op2 > 0 && result < 0) { else if (op1 > 0 && op2 > 0 && result < 0)
result = 0x7fffffff; result = 0x7fffffff;
}
return result; return result;
} }
...@@ -67,13 +67,13 @@ s16 qm_add16(s16 op1, s16 op2) ...@@ -67,13 +67,13 @@ s16 qm_add16(s16 op1, s16 op2)
{ {
s16 result; s16 result;
s32 temp = (s32) op1 + (s32) op2; s32 temp = (s32) op1 + (s32) op2;
if (temp > (s32) 0x7fff) { if (temp > (s32) 0x7fff)
result = (s16) 0x7fff; result = (s16) 0x7fff;
} else if (temp < (s32) 0xffff8000) { else if (temp < (s32) 0xffff8000)
result = (s16) 0xffff8000; result = (s16) 0xffff8000;
} else { else
result = (s16) temp; result = (s16) temp;
}
return result; return result;
} }
...@@ -85,13 +85,13 @@ s16 qm_sub16(s16 op1, s16 op2) ...@@ -85,13 +85,13 @@ s16 qm_sub16(s16 op1, s16 op2)
{ {
s16 result; s16 result;
s32 temp = (s32) op1 - (s32) op2; s32 temp = (s32) op1 - (s32) op2;
if (temp > (s32) 0x7fff) { if (temp > (s32) 0x7fff)
result = (s16) 0x7fff; result = (s16) 0x7fff;
} else if (temp < (s32) 0xffff8000) { else if (temp < (s32) 0xffff8000)
result = (s16) 0xffff8000; result = (s16) 0xffff8000;
} else { else
result = (s16) temp; result = (s16) temp;
}
return result; return result;
} }
...@@ -110,12 +110,12 @@ s32 qm_shl32(s32 op, int shift) ...@@ -110,12 +110,12 @@ s32 qm_shl32(s32 op, int shift)
else if (shift < -31) else if (shift < -31)
shift = -31; shift = -31;
if (shift >= 0) { if (shift >= 0) {
for (i = 0; i < shift; i++) { for (i = 0; i < shift; i++)
result = qm_add32(result, result); result = qm_add32(result, result);
}
} else { } else {
result = result >> (-shift); result = result >> (-shift);
} }
return result; return result;
} }
...@@ -134,12 +134,12 @@ s16 qm_shl16(s16 op, int shift) ...@@ -134,12 +134,12 @@ s16 qm_shl16(s16 op, int shift)
else if (shift < -15) else if (shift < -15)
shift = -15; shift = -15;
if (shift > 0) { if (shift > 0) {
for (i = 0; i < shift; i++) { for (i = 0; i < shift; i++)
result = qm_add16(result, result); result = qm_add16(result, result);
}
} else { } else {
result = result >> (-shift); result = result >> (-shift);
} }
return result; return result;
} }
......
...@@ -435,14 +435,13 @@ brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt, ...@@ -435,14 +435,13 @@ brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
(PHYTYPE_IS(phy_type, PHY_TYPE_N)) || (PHYTYPE_IS(phy_type, PHY_TYPE_N)) ||
(PHYTYPE_IS(phy_type, PHY_TYPE_LCN)) || (PHYTYPE_IS(phy_type, PHY_TYPE_LCN)) ||
(PHYTYPE_IS(phy_type, PHY_TYPE_SSN))) { (PHYTYPE_IS(phy_type, PHY_TYPE_SSN))) {
if (BAND_5G(bandtype)) { if (BAND_5G(bandtype))
rs_dflt = (bw == BRCMS_20_MHZ ? rs_dflt = (bw == BRCMS_20_MHZ ?
&ofdm_mimo_rates : &ofdm_40bw_mimo_rates); &ofdm_mimo_rates : &ofdm_40bw_mimo_rates);
} else { else
rs_dflt = (bw == BRCMS_20_MHZ ? rs_dflt = (bw == BRCMS_20_MHZ ?
&cck_ofdm_mimo_rates : &cck_ofdm_mimo_rates :
&cck_ofdm_40bw_mimo_rates); &cck_ofdm_40bw_mimo_rates);
}
} else if (PHYTYPE_IS(phy_type, PHY_TYPE_LP)) { } else if (PHYTYPE_IS(phy_type, PHY_TYPE_LP)) {
rs_dflt = (BAND_5G(bandtype)) ? &ofdm_rates : &cck_ofdm_rates; rs_dflt = (BAND_5G(bandtype)) ? &ofdm_rates : &cck_ofdm_rates;
} else if (PHYTYPE_IS(phy_type, PHY_TYPE_A)) { } else if (PHYTYPE_IS(phy_type, PHY_TYPE_A)) {
......
...@@ -901,21 +901,20 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff, ...@@ -901,21 +901,20 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
if (check_crc) { if (check_crc) {
if (buf[0] == 0xffff) { if (buf[0] == 0xffff)
/* The hardware thinks that an srom that starts with 0xffff /* The hardware thinks that an srom that starts with 0xffff
* is blank, regardless of the rest of the content, so declare * is blank, regardless of the rest of the content, so declare
* it bad. * it bad.
*/ */
return -ENODATA; return -ENODATA;
}
/* fixup the endianness so crc8 will pass */ /* fixup the endianness so crc8 will pass */
htol16_buf(buf, nwords * 2); htol16_buf(buf, nwords * 2);
if (brcmu_crc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) != if (brcmu_crc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
CRC8_GOOD_VALUE) { CRC8_GOOD_VALUE)
/* DBG only pci always read srom4 first, then srom8/9 */ /* DBG only pci always read srom4 first, then srom8/9 */
err = -EIO; err = -EIO;
}
/* now correct the endianness of the byte array */ /* now correct the endianness of the byte array */
ltoh16_buf(buf, nwords * 2); ltoh16_buf(buf, nwords * 2);
} }
...@@ -930,9 +929,8 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz) ...@@ -930,9 +929,8 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
int err = 0; int err = 0;
otp = kzalloc(OTP_SZ_MAX, GFP_ATOMIC); otp = kzalloc(OTP_SZ_MAX, GFP_ATOMIC);
if (otp == NULL) { if (otp == NULL)
return -ENOMEM; return -ENOMEM;
}
err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz); err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz);
...@@ -941,20 +939,19 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz) ...@@ -941,20 +939,19 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
kfree(otp); kfree(otp);
/* Check CRC */ /* Check CRC */
if (buf[0] == 0xffff) { if (buf[0] == 0xffff)
/* The hardware thinks that an srom that starts with 0xffff /* The hardware thinks that an srom that starts with 0xffff
* is blank, regardless of the rest of the content, so declare * is blank, regardless of the rest of the content, so declare
* it bad. * it bad.
*/ */
return -ENODATA; return -ENODATA;
}
/* fixup the endianness so crc8 will pass */ /* fixup the endianness so crc8 will pass */
htol16_buf(buf, bufsz); htol16_buf(buf, bufsz);
if (brcmu_crc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) != if (brcmu_crc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
CRC8_GOOD_VALUE) { CRC8_GOOD_VALUE)
err = -EIO; err = -EIO;
}
/* now correct the endianness of the byte array */ /* now correct the endianness of the byte array */
ltoh16_buf(buf, bufsz); ltoh16_buf(buf, bufsz);
......
...@@ -80,16 +80,14 @@ void brcms_c_tempsense_upd(struct brcms_c_info *wlc) ...@@ -80,16 +80,14 @@ void brcms_c_tempsense_upd(struct brcms_c_info *wlc)
txchain = active_chains & 0xf; txchain = active_chains & 0xf;
if (wlc->stf->txchain == wlc->stf->hw_txchain) { if (wlc->stf->txchain == wlc->stf->hw_txchain) {
if (txchain && (txchain < wlc->stf->hw_txchain)) { if (txchain && (txchain < wlc->stf->hw_txchain))
/* turn off 1 tx chain */ /* turn off 1 tx chain */
brcms_c_stf_txchain_set(wlc, txchain, true); brcms_c_stf_txchain_set(wlc, txchain, true);
}
} else if (wlc->stf->txchain < wlc->stf->hw_txchain) { } else if (wlc->stf->txchain < wlc->stf->hw_txchain) {
if (txchain == wlc->stf->hw_txchain) { if (txchain == wlc->stf->hw_txchain)
/* turn back on txchain */ /* turn back on txchain */
brcms_c_stf_txchain_set(wlc, txchain, true); brcms_c_stf_txchain_set(wlc, txchain, true);
} }
}
} }
void void
...@@ -136,9 +134,8 @@ brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel, ...@@ -136,9 +134,8 @@ brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel,
static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val) static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
{ {
if ((int_val != AUTO) && (int_val != OFF) && (int_val != ON)) { if ((int_val != AUTO) && (int_val != OFF) && (int_val != ON))
return false; return false;
}
if ((int_val == ON) && (wlc->stf->txstreams == 1)) if ((int_val == ON) && (wlc->stf->txstreams == 1))
return false; return false;
...@@ -158,9 +155,8 @@ static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val) ...@@ -158,9 +155,8 @@ static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val) bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val)
{ {
if ((int_val != HT_CAP_RX_STBC_NO) if ((int_val != HT_CAP_RX_STBC_NO)
&& (int_val != HT_CAP_RX_STBC_ONE_STREAM)) { && (int_val != HT_CAP_RX_STBC_ONE_STREAM))
return false; return false;
}
if (BRCMS_STF_SS_STBC_RX(wlc)) { if (BRCMS_STF_SS_STBC_RX(wlc)) {
if ((int_val != HT_CAP_RX_STBC_NO) if ((int_val != HT_CAP_RX_STBC_NO)
...@@ -178,15 +174,13 @@ static int brcms_c_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts, ...@@ -178,15 +174,13 @@ static int brcms_c_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts,
BCMMSG(wlc->wiphy, "wl%d: Nsts %d core_mask %x\n", BCMMSG(wlc->wiphy, "wl%d: Nsts %d core_mask %x\n",
wlc->pub->unit, Nsts, core_mask); wlc->pub->unit, Nsts, core_mask);
if (BRCMS_BITSCNT(core_mask) > wlc->stf->txstreams) { if (BRCMS_BITSCNT(core_mask) > wlc->stf->txstreams)
core_mask = 0; core_mask = 0;
}
if ((BRCMS_BITSCNT(core_mask) == wlc->stf->txstreams) && if ((BRCMS_BITSCNT(core_mask) == wlc->stf->txstreams) &&
((core_mask & ~wlc->stf->txchain) ((core_mask & ~wlc->stf->txchain)
|| !(core_mask & wlc->stf->txchain))) { || !(core_mask & wlc->stf->txchain)))
core_mask = wlc->stf->txchain; core_mask = wlc->stf->txchain;
}
wlc->stf->txcore[Nsts] = core_mask; wlc->stf->txcore[Nsts] = core_mask;
/* Nsts = 1..4, txcore index = 1..4 */ /* Nsts = 1..4, txcore index = 1..4 */
...@@ -375,9 +369,8 @@ static void _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc) ...@@ -375,9 +369,8 @@ static void _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc)
if (BRCMS_ISNPHY(wlc->band) && if (BRCMS_ISNPHY(wlc->band) &&
NREV_GE(wlc->band->phyrev, 3) NREV_GE(wlc->band->phyrev, 3)
&& NREV_LT(wlc->band->phyrev, 7)) { && NREV_LT(wlc->band->phyrev, 7))
wlc->stf->phytxant = PHY_TXC_ANT_2; wlc->stf->phytxant = PHY_TXC_ANT_2;
}
} else { } else {
if (BRCMS_ISLCNPHY(wlc->band) || if (BRCMS_ISLCNPHY(wlc->band) ||
BRCMS_ISSSLPNPHY(wlc->band)) BRCMS_ISSSLPNPHY(wlc->band))
...@@ -414,23 +407,21 @@ void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc) ...@@ -414,23 +407,21 @@ void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc)
/* these parameter are intended to be used for all PHY types */ /* these parameter are intended to be used for all PHY types */
if (wlc->stf->hw_txchain == 0 || wlc->stf->hw_txchain == 0xf) { if (wlc->stf->hw_txchain == 0 || wlc->stf->hw_txchain == 0xf) {
if (BRCMS_ISNPHY(wlc->band)) { if (BRCMS_ISNPHY(wlc->band))
wlc->stf->hw_txchain = TXCHAIN_DEF_NPHY; wlc->stf->hw_txchain = TXCHAIN_DEF_NPHY;
} else { else
wlc->stf->hw_txchain = TXCHAIN_DEF; wlc->stf->hw_txchain = TXCHAIN_DEF;
} }
}
wlc->stf->txchain = wlc->stf->hw_txchain; wlc->stf->txchain = wlc->stf->hw_txchain;
wlc->stf->txstreams = (u8) BRCMS_BITSCNT(wlc->stf->hw_txchain); wlc->stf->txstreams = (u8) BRCMS_BITSCNT(wlc->stf->hw_txchain);
if (wlc->stf->hw_rxchain == 0 || wlc->stf->hw_rxchain == 0xf) { if (wlc->stf->hw_rxchain == 0 || wlc->stf->hw_rxchain == 0xf) {
if (BRCMS_ISNPHY(wlc->band)) { if (BRCMS_ISNPHY(wlc->band))
wlc->stf->hw_rxchain = RXCHAIN_DEF_NPHY; wlc->stf->hw_rxchain = RXCHAIN_DEF_NPHY;
} else { else
wlc->stf->hw_rxchain = RXCHAIN_DEF; wlc->stf->hw_rxchain = RXCHAIN_DEF;
} }
}
wlc->stf->rxchain = wlc->stf->hw_rxchain; wlc->stf->rxchain = wlc->stf->hw_rxchain;
wlc->stf->rxstreams = (u8) BRCMS_BITSCNT(wlc->stf->hw_rxchain); wlc->stf->rxstreams = (u8) BRCMS_BITSCNT(wlc->stf->hw_rxchain);
...@@ -448,9 +439,9 @@ static u16 _brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc, ...@@ -448,9 +439,9 @@ static u16 _brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
{ {
u16 phytxant = wlc->stf->phytxant; u16 phytxant = wlc->stf->phytxant;
if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO) { if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO)
phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT; phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
} else if (wlc->stf->txant == ANT_TX_DEF) else if (wlc->stf->txant == ANT_TX_DEF)
phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT; phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
phytxant &= PHY_TXC_ANT_MASK; phytxant &= PHY_TXC_ANT_MASK;
return phytxant; return phytxant;
......
...@@ -244,9 +244,8 @@ brcmu_pktq_pflush(struct pktq *pq, int prec, bool dir, ...@@ -244,9 +244,8 @@ brcmu_pktq_pflush(struct pktq *pq, int prec, bool dir,
} }
} }
if (q->head == NULL) { if (q->head == NULL)
q->tail = NULL; q->tail = NULL;
}
} }
EXPORT_SYMBOL(brcmu_pktq_pflush); EXPORT_SYMBOL(brcmu_pktq_pflush);
...@@ -404,26 +403,23 @@ int brcmu_iovar_lencheck(const struct brcmu_iovar *vi, void *arg, int len, ...@@ -404,26 +403,23 @@ int brcmu_iovar_lencheck(const struct brcmu_iovar *vi, void *arg, int len,
case IOVT_UINT16: case IOVT_UINT16:
case IOVT_UINT32: case IOVT_UINT32:
/* all integers are s32 sized args at the ioctl interface */ /* all integers are s32 sized args at the ioctl interface */
if (len < (int)sizeof(int)) { if (len < (int)sizeof(int))
bcmerror = -EOVERFLOW; bcmerror = -EOVERFLOW;
}
break; break;
case IOVT_BUFFER: case IOVT_BUFFER:
/* buffer must meet minimum length requirement */ /* buffer must meet minimum length requirement */
if (len < vi->minlen) { if (len < vi->minlen)
bcmerror = -EOVERFLOW; bcmerror = -EOVERFLOW;
}
break; break;
case IOVT_VOID: case IOVT_VOID:
if (!set) { if (!set)
/* Cannot return nil... */ /* Cannot return nil... */
bcmerror = -ENOTSUPP; bcmerror = -ENOTSUPP;
} else if (len) { else if (len)
/* Set is an action w/o parameters */ /* Set is an action w/o parameters */
bcmerror = -ENOBUFS; bcmerror = -ENOBUFS;
}
break; break;
default: default:
...@@ -670,10 +666,9 @@ u16 brcmu_qdbm_to_mw(u8 qdbm) ...@@ -670,10 +666,9 @@ u16 brcmu_qdbm_to_mw(u8 qdbm)
uint factor = 1; uint factor = 1;
int idx = qdbm - QDBM_OFFSET; int idx = qdbm - QDBM_OFFSET;
if (idx >= QDBM_TABLE_LEN) { if (idx >= QDBM_TABLE_LEN)
/* clamp to max u16 mW value */ /* clamp to max u16 mW value */
return 0xFFFF; return 0xFFFF;
}
/* scale the qdBm index up to the range of the table 0-40 /* scale the qdBm index up to the range of the table 0-40
* where an offset of 40 qdBm equals a factor of 10 mW. * where an offset of 40 qdBm equals a factor of 10 mW.
......
...@@ -34,8 +34,7 @@ bool brcmu_chspec_malformed(u16 chanspec) ...@@ -34,8 +34,7 @@ bool brcmu_chspec_malformed(u16 chanspec)
if (CHSPEC_IS20(chanspec)) { if (CHSPEC_IS20(chanspec)) {
if (!CHSPEC_SB_NONE(chanspec)) if (!CHSPEC_SB_NONE(chanspec))
return true; return true;
} else { } else if (!CHSPEC_SB_UPPER(chanspec) && !CHSPEC_SB_LOWER(chanspec)) {
if (!CHSPEC_SB_UPPER(chanspec) && !CHSPEC_SB_LOWER(chanspec))
return true; return true;
} }
...@@ -60,14 +59,13 @@ u8 brcmu_chspec_ctlchan(u16 chspec) ...@@ -60,14 +59,13 @@ u8 brcmu_chspec_ctlchan(u16 chspec)
/* chanspec channel holds the centre frequency, use that and the /* chanspec channel holds the centre frequency, use that and the
* side band information to reconstruct the control channel number * side band information to reconstruct the control channel number
*/ */
if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_UPPER) { if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_UPPER)
/* control chan is the upper 20 MHZ SB of the 40MHZ channel */ /* control chan is the upper 20 MHZ SB of the 40MHZ channel */
ctl_chan = UPPER_20_SB(CHSPEC_CHANNEL(chspec)); ctl_chan = UPPER_20_SB(CHSPEC_CHANNEL(chspec));
} else { else
/* control chan is the lower 20 MHZ SB of the 40MHZ channel */ /* control chan is the lower 20 MHZ SB of the 40MHZ channel */
ctl_chan = LOWER_20_SB(CHSPEC_CHANNEL(chspec)); ctl_chan = LOWER_20_SB(CHSPEC_CHANNEL(chspec));
} }
}
return ctl_chan; return ctl_chan;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment