extern void dhd_os_sdlock_eventq(dhd_pub_t * pub);
extern void dhd_os_sdunlock_eventq(dhd_pub_t * pub);
extern bool dhd_os_check_hang(dhd_pub_t *dhdp, int ifidx, int ret);
+extern int dhd_os_send_hang_message(dhd_pub_t *dhdp);
extern int net_os_send_hang_message(struct net_device *dev);
extern void dhd_set_version_info(dhd_pub_t *pub, char *fw);
#endif
}
}
+#endif
-int net_os_send_hang_message(struct net_device *dev)
+int dhd_os_send_hang_message(dhd_pub_t *dhdp)
{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int ret = 0;
- if (dhd) {
- if (!dhd->pub.hang_was_sent) {
- dhd->pub.hang_was_sent = 1;
- schedule_work(&dhd->work_hang);
+ if (dhdp) {
+ if (!dhdp->hang_was_sent) {
+ dhdp->hang_was_sent = 1;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
+ schedule_work(&dhdp->info->work_hang);
+#endif
}
}
return ret;
}
-#endif
+
+int net_os_send_hang_message(struct net_device *dev)
+{
+ dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+ int ret = 0;
+
+ if (dhd)
+ ret = dhd_os_send_hang_message(&dhd->pub);
+
+ return ret;
+}
void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec)
{
static int
dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
{
+#define HT_AVAIL_ERROR_MAX 10
+ static int ht_avail_error = 0;
int err;
uint8 clkctl, clkreq, devctl;
bcmsdh_info_t *sdh;
clkctl = 0;
sdh = bus->sdh;
-
if (on) {
/* Request HT Avail */
clkreq = bus->alp_only ? SBSDIO_ALP_AVAIL_REQ : SBSDIO_HT_AVAIL_REQ;
-
-
-
bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
if (err) {
- DHD_ERROR(("%s: HT Avail request error: %d\n", __FUNCTION__, err));
+ ht_avail_error++;
+ if (ht_avail_error < HT_AVAIL_ERROR_MAX) {
+ DHD_ERROR(("%s: HT Avail request error: %d\n", __FUNCTION__, err));
+ } else {
+ if (ht_avail_error == HT_AVAIL_ERROR_MAX)
+ dhd_os_send_hang_message(bus->dhd);
+ }
return BCME_ERROR;
+ } else {
+ ht_avail_error = 0;
}
if (pendok &&